ember-object-at-helper

0.1.0 • Public • Published

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

Package Sidebar

Install

npm i ember-object-at-helper

Weekly Downloads

2

Version

0.1.0

License

MIT

Last publish

Collaborators

  • jelhan