Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

{{#each controller}} {{name}} {{/each}}

How is the controller not the data as far as the View is concerned?



As mentioned above, the proxied model data is actually stored in a controller's "content" field. So that snippet is actually just shorthand for {{#each controller.content}} {{/each}}


It's not quite a shorthand as the controller can have properties of its own as well. However, the general understanding is correct, the controller proxies to the content. The controller is not the data, but it acts like it.


Exactly. I think this is where a good deal of confusion about the controller/model relationship is arising.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: