Multiple Models in a View
How to use multiple models in a view? Retrieve another data and set to controller in Route’s setupController method.
1 2 3 4 5 6 7 8 9 10 | |
I create CategoryView and bind data to it in template
{{#each category in categorys}}
{{#view CategoryView contentBinding="category"}}
{{category.name}}
{{/view}}
{{/each}}
{{#each place in content}}
{{place.name}}
{{/each}}
CategoryView code: I use classNameBinding to auto update class when status is changed.
1 2 3 4 5 6 7 8 9 10 | |