@belgoros wrote:
I wonder what is the difference between the following actions definitions:
- When defined as
<a {{action 'login'}}>Login</a>
- When defined as {{#link-to ‘index’ }}Home{{/link-to}}
Is is correct to say that when using with
{{#link-to 'index' }}
helper, I should always define a route with the same name as the String passed in tolink_to
helper ?
- Should actions be always declared in controllers only ?
- What does the below declaration (
onLogin
) mean (inapp/components/main-navigation.js
):actions: { login() { // Closure actions are not yet available in Ember 1.12 // eslint-disable-next-line ember/closure-actions this.sendAction('onLogin'); },
- What does the
onLogin='transitionToLoginRoute
declaration mean (inapp/templates/application.hbs
):{{main-navigation onLogin='transitionToLoginRoute'}}
There is no action
onLogin
defined anywhere. Is there any convention to explain this ? Thank you.
Posts: 2
Participants: 2