Reputation: 181
Today I have come to a shocking discovery: actions referenced on a view are handled by their route, not by the view which referenced it. Ex:
<a href="#" {{action edit}}>Edit this</a>
The edit
action must be defined in the Route, not in the View. When I was not using a Router before the View was the one responsible for handling such events and I was really happy about it.
Can anyone please:
Upvotes: 4
Views: 2208
Reputation: 8041
Set the target as view
<a href="#" {{action edit target="view"}}>Edit this</a>
If your action is in controller then use
<a href="#" {{action edit}}>Edit this</a>
Default target refers to the view's controller
I'd suggest you to go through this Reference: Ember Action Helper
I'd like to mention some key points as per the above reference
Upvotes: 16