0
我试图在注册表单上创建提交操作。这里是我的注册车把:表单提交操作错误emberjs
<form class="form-signin" {{action "register" on="submit"}}>
{{input class="form-control" value=username type="text" placeholder="Username"}}
{{input class="form-control" value=password type="password" placeholder="Password" }}
<button class="btn btn-lg btn-primary btn-block" type="submit">Register</button>
</form>
这里路由器:
import Ember from 'ember';
import config from './config/environment';
var Router = Ember.Router.extend({
location: config.locationType
});
Router.map(function() {
this.resource('register', {path: '/register'});
});
export default Router;
,这里是我的注册控制器:
import Ember from 'ember';
export default Ember.Controller.extend({
register: function(){
return 'hello';
}
});
当我提交表单我得到这个错误:
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.
我是什么做错了?