javascript - Am I doing it right? {{#each}} -


i have question because i'm curious if right. i'm reading tutorials ember.js every 1 typing that:

{{#each friend in model}}    {{friend.firstname}} {{friend.lastname}} {{/each}} 

and in app route example: app/templates/works/index.hbs have:

{{#each}}    {{#link-to 'works.work'  this.id class="trigger"}}       <h3 class="title">{{name}}</h3>       <p class="description">{{description}}</p>       <img {{bind-attr src=image}}>    {{/link-to}} {{/each}} 

but still working fine, thats convention or doing wrong time?

you should go first form, non-context switching form of {{each}}, second form deprecated. see here.

the first form less confusing don't need think of context properties.


Comments

Popular posts from this blog

c++ - OpenMP unpredictable overhead -

ruby on rails - RuntimeError: Circular dependency detected while autoloading constant - ActiveAdmin.register Role -

javascript - Wordpress slider, not displayed 100% width -