{{object-at}} Ember HTMLBars Helper
npm install ember-object-at-helperHTMLBars template helper to lookup an element of an array.
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 PoitrasComplex 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-helperRunning Tests
*
npm test (Runs ember try:testall to test your addon against multiple Ember versions)
* ember test`