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.
There's nothing at all wrong with doing that. That's the purpose of the context.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With