Reputation: 18557
Say I have the following template
{{#each item in controller}}
<a {{action "doSomething" item}}>{{item.name}}</a>
{{/each}}
Now I have the following action defined in the router.
doSomething: function(router, event){
event.context.get('name');
}
is there anything wrong with accessing the property this way? I'm just asking because I haven't seen this anywhere else.
Upvotes: 3
Views: 748
Reputation: 8389
There's nothing at all wrong with doing that. That's the purpose of the context.
Upvotes: 6