ember.js - Ember {{each}} vs {{each x in controller}} -
when use {{each}} example:
{{#each imagepost}} <li>{{title}}</li> {{else}} empty :o {{/each}}
i 'empty :o' message
when this:
{{#each imagepost in controller}} <li>{{imagepost.title}}</li> {{else}} empty :o {{/each}}
it works fine!
it weird cause docs says this:
{{#each people}} <li>hello, {{name}}!</li> {{/each}}
which doesnt work me =/
does shortened version won't apply models? controller's properties?
the shortened version applies properties on controller/model or controller/model. in case be:
{{#each controller}} <li>{{title}}</li> {{else}} empty :o {{/each}}
or
{{#each model}} <li>{{title}}</li> {{else}} empty :o {{/each}}
note, if {{#each model}}
, have itemcontroller
defined on array controller won't wrap each item item controller, need this: {{#each model itemcontroller='foo'}}
.
Comments
Post a Comment