Can someone briefly describe the different ways you can loop over a collection of models in handlebars? And why you would use one approach vs another?
And yes I am aware of http://emberjs.com/guides/templates/displaying-a-list-of-items/
Looking over code samples it seems I have seen the pattern expressed in a lot of different ways but not clear on the nuance or rationale for some of the different forms.
So far I have seen the following:
With a model or controller named people
{{#each people}}
Hello, {{name}}
{{/each}}
just the bare model This presume no controller?
{{#each model}}
Hello, {{name}}
{{/each}}
just the model with an identifier I assume this is recommended for nesting templates and avoiding property member collisions between inner and outer templates
{{#each item in model}}
Hello, {{item.name}}
{{/each}}
just the controller proxied to the model
{{#each controller}}
Hello, {{name}}
{{/each}}
just the controller proxied to the model with identifier
{{#each item in controller}}
Hello, {{item.name}}
{{/each}}
what is the difference between controller and content?
{{#each item in content}}
Hello, {{item.name}}
{{/each}}
Other forms looping over a list takes?
Loop with index or conditional at each iteration?
For example is this pattern possible?
{{#each item in controller}}
Hello, {{item.name}}
{{ #if item.foo }}
The foo: {{ foo }}
{{ else }}
There is no foo.
{{/if }}
{{/each}}