I have a simple array in the controller:
App.HomeController = Ember.Controller.extend({
items: ['item1', 'item2', 'item3']
});
I would like to render the first element in the template; following instructions in other posts I'm doing:
{{items.[0]}}
Or this…
{{controller.items.[0]}}
…but the result is always nothing; am I doing anything wrong here?
You're doing nothing wrong. These should work (demo). The problem lies somewhere else. Can't tell without more code.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With