That will come over time. If you really want to know about all the newest stuff you have to follow the commit logs
@yyy Well, it really is not much to be honest (just a temporary fix). Say controller B “needs” controller A (but A is not a singleton so you can’t use “needs”). Every time the needed property changes in model A, it sets a matching property on model B. So everything happens as if controller B was querying its own model.
But again: it is just a temporary way to do this (as discussed in the SO thread). It is not a recommended pattern.
Ok no problem. cheers.
I saw that the ‘each’ used to loop in the fiddle didn’t have the pound ie ‘#’ sign in front of it.
{{each controller itemController="post" itemViewClass="App.PostView"}}
So when do we use ‘each’ as used above and when do we use it in this form;
{{#each controller}}
{{/each}}
I discover that if I wrap your code with the each that uses {{#each}} it fails.
So there are differences but I can’t find it documented anywhere. Does it also means there are scenarios where we can do {{if }} instead of {{#if }}.
cheers
When you use {{#each}}
and {{/each}}
(the block version) you can set an inline template, i.e. the template to use for each item in the array. When you use {{each}}
(the non-block version) you need to set an itemViewClass
, otherwise there is nothing to display.
I would advise to only use block each
’es with very simple content. As soon as you need more dynamic views, you should create a specialized view, using the non-block version and itemViewClass
(and itemController
).
No. There is no non-block version of {{#if}}
.
Ok thanks for the explanation.