0.1.0 • Published 9 years ago

ember-object-at-helper v0.1.0

Weekly downloads
52
License
MIT
Repository
github
Last release
9 years ago

ember-object-at-helper Build Status Code Climate

HTMLBars template helper to lookup an element of an array.

Usage

Ember.Component.extend({
  whistleblowers: [
    { name: 'Edward Snowden' }
  ],
  directors: ['Laura Poitras'];
  documentaries: [
    { title: 'Citizenfour' }
  ]
  key: 'title'
});

Simple examples:

  • {{object-at whistleblowers 0 'name'}} = Edward Snowden
  • {{object-at directors 0}} = Laura Poitras

Complex example:

{{#each whistleblowers as |whistleblower index|}}
  {{object-at directors index}} produced the great documentary
  {{object-at documentaries index key}} about {{whistleblower.name}}.
{{/each}}

Installation

  • ember install ember-object-at-helper

Running Tests

  • npm test (Runs ember try:testall to test your addon against multiple Ember versions)
  • ember test