"Routes and controllers that handle actions must place action handlers inside an actions hash. Even if a route has a method with the same name as the actions, it will not be triggered unless it is inside an actions hash. In the case of a controller, while there is deprecated support for triggering a method directly on the controller, it is strongly recommended that you put your action handling methods inside an actions hash for forward compatibility."
That is from the ember documentation, it sounds like I should put my actions inside the actions hash within a controller, but after I put the action inside the hash, my controller complains that Uncaught Error: Nothing handled the event 'submit'.
//this works
App.StartController = Ember.Controller.extend({
submit:function(){
alert(1);
}
});
// this complains Uncaught Error: Nothing handled the event 'submit'.
App.StartController = Ember.Controller.extend({
actions:{
submit:function(){
alert(1);
}
}
});
BTW, I am using v1.0.0rc