https://github.com/jelhan/ember-object-at-helper
{{object-at}} Ember HTMLBars Helper
https://github.com/jelhan/ember-object-at-helper
Last synced: about 2 months ago
JSON representation
{{object-at}} Ember HTMLBars Helper
- Host: GitHub
- URL: https://github.com/jelhan/ember-object-at-helper
- Owner: jelhan
- License: mit
- Created: 2016-06-08T15:37:43.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2018-06-23T13:40:47.000Z (almost 7 years ago)
- Last Synced: 2024-10-30T03:49:58.273Z (7 months ago)
- Language: JavaScript
- Size: 12.7 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# ember-object-at-helper [](https://travis-ci.org/jelhan/ember-object-at-helper) [](https://codeclimate.com/github/jelhan/ember-object-at-helper.js)
HTMLBars template helper to lookup an element of an array.
> **Deprecated** Please use `{{object-at}}` template helper provided by [ember-composable-helpers](https://github.com/DockYard/ember-composable-helpers).
## 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 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-helper`
## Running Tests
* `npm test` (Runs `ember try:testall` to test your addon against multiple Ember versions)
* `ember test`## See also
[ember-composable-helpers](https://github.com/DockYard/ember-composable-helpers) also includes an [`object-at` template helper](https://github.com/DockYard/ember-composable-helpers#object-at).