ember.js - Difference between Controller and Route in emberjs -
this has been confusing me since started using ember js. using ember js 2.11 (as shown in package.json "ember-cli": "2.11.1"
)
i trying emit onclick action component route , got error "an action named 'getdetails' not found in generated controller" when had action named getdetails in route.
i have read ember 2.0+ controller has been deprecated , route made same purpose.
please clarify.
- controllers not yet deprecated. use them as documented, once become deprecated, there clear , painless upgrade path.
- when send action
{{action "getdetails"}}
template not component's template, controller default action handler. phrasegenerated controller
in error tells didn't create one, ember did work creating anonymous controller. definition, has no actions, properties or anything. create controller, if want handle action. - or, if want handle action on route (or 1 of parent routes), use ember-route-action-helper addon.
"ember-cli": "2.11.1"
insidepackage.json
tells version of ember cli (the command line interface), ember version either"ember-source"
inside same file, or"ember"
insidebower.json
.
hint: read guides carefully! :)
Comments
Post a Comment