Reputation: 6373
Is there any way to do something like that in Ember.js template?
{{someObject.someArray[0].arrayPropery}}
When object structure looks like this:
someObject: {
someArray: [
{
arrayProperty: 'Show me in template!'
}
]
}
Upvotes: 1
Views: 1601
Reputation: 8732
You could use: {{ someObject.someArray.firstObject.property }}
but it's better to provide a computed property in your controller which returns the desired property.
Upvotes: 1