Reputation: 1327
This has been very confusing for me since I started using ember js.
I am using ember js 2.11 (as shown in my package.json "ember-cli": "2.11.1"
)
I was trying to emit onClick action from my component to route and i got the error "An action named 'getDetails' was not found in generated controller" even when i had action named getDetails in my route.
I have read that with ember 2.0+ controller has been deprecated and route is made for the same purpose.
Please clarify.
Upvotes: 0
Views: 965
Reputation: 1134
{{action "getDetails"}}
from a template that is not a component's template, the controller is the default action handler. The phrase generated controller
in the error tells that you didn't create one, so Ember did the work for you by creating an anonymous controller. By definition, it has no actions, properties or anything. Create a controller, if you want to handle the action."ember-cli": "2.11.1"
inside package.json
only tells you the version of the Ember CLI (the command line interface), the Ember version is either "ember-source"
inside the same file, or "ember"
inside bower.json
.Hint: Read the guides carefully! :)
Upvotes: 3