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
Post a Comment