I tried setting 'elementId' instead of 'id' in '#each', but it didn't seem to work ...
Otherwise, you can create an animal list view.
App.AnimalsListView = Ember.CollectionView.extend({ tagName: 'ul', contentBinding: 'App.itemsController.content', classNames: ['animals'], elementId: 'animalsList', itemViewClass: Ember.View.extend({ classNames: ['animal'], templateName: 'ember/templates/animals/animal', elementId:Ember.computed(function(){ 'animal-'+this.getPath('content.name') }) }) });
In your animal template:
{{ content.get('name') }} - {{ content.get('pluralized') }}
And finally, in your main html file
<script type="text/x-handlebars"> {{ view App.AnimalsListView }} </script>
source share