Ember.js pass route from controller to linkTo -
Ember.js pass route from controller to linkTo -
in controller have next definition:
this.tabs = ember.a([ ember.object.create({ title:"all contacts", active:true, linkto:"contact.list.all" }), ember.object.create({ title:"my contacts", active:false, linkto:"contact.list.my" }) ]);
and in html have next loop:
{{#each tab in tabs}} <li {{bindattr class="tab.active:active"}} > {{#linkto tab.linkto data-toggle="tab"}} {{tab.title}} {{/linkto}}</li> {{/each}}
when run view error saying "the route tab.linkto not found", because linkto helper exepects route object.
i've tried passing route straight using e.g.
linkto:app.router.router.gethandler("contact.list.my")
but same error.
so how can dynamically set route linkto helper?
ember.js
Comments
Post a Comment