ember-object-at-helper
v0.1.0
Published
{{object-at}} Ember HTMLBars Helper
Downloads
2
Readme
ember-object-at-helper
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
(Runsember try:testall
to test your addon against multiple Ember versions)ember test