In a template:
{{#each displayVideos}}
Index: {{_view.contentIndex}}
{{/each}}
It will display all item in model.
But I want to display only some item depend on index(ex: Display item if index%2==0).
Any idea about it? Thanks
In a template:
{{#each displayVideos}}
Index: {{_view.contentIndex}}
{{/each}}
It will display all item in model.
But I want to display only some item depend on index(ex: Display item if index%2==0).
Any idea about it? Thanks
Create a computed property in your controller, that will only return every second row, and iterate over that instead...
Something like:
Then in your template: