I'm working on implementing a simple login on a learning project. When I click on my Register button, I get this error:
Uncaught Error: Nothing handled the action 'register'. If you did handle the action, this error can be caused by returning true from an action handler in a controller, causing the action to bubble.
My login HTML code is in my Nav partial. That partial is inserted into my Index template (other templates and routes as well, but I'm starting here). So I figured that adding my code to my App.IndexController
would do the trick. I reread the part in Ember's guide about how actions can bubble up. So I tried to put it in my App.IndexRoute
and even my App.ApplicationRoute
but I still get the error.
Heres the relevant code as of that last try:
My router
App.ApplicationRoute = Ember.Route.extend({
action: {
register: function() {
var email = this.get('registerEmail');
var pass1 = this.get('registerPass');
var pass2 = this.get('confirmRegisterPass');
console.log(email + ' ' + pass1 + ' ' + pass2)
}
}
})
And my HTML
<h2>Register :</h2>
{{input placeholder='Email' value=registerEmail}}
{{input placeholder='Password' value=registerPass}}
{{input placeholder='Confirm Passord' value=confirmRegisterPass}}
<button class="tiny small" {{action 'register' this}}>Register</button>