0
如何在Backbone js中创建注册表单?并发送POST到我的后端,我不明白这种情况下收集的想法。主干需要js注册
我得到了什么至今:
define(['jQuery', 'Underscore', 'Backbone', 'text!templates/signup.html', 'models/UserRegistration'],
function($, _, Backbone, signUpTemplate, UserRegistration){
var SignUpView = Backbone.View.extend({
el: $('#screen'),
events: {
'submit #frm-signup': 'signup'
},
signup: function(){
// Do something
},
render: function(){
$(this.el).html(_.template(signUpTemplate, {}));
return this;
}
});
return new SignUpView;
});
和模型:
define(['Underscore', 'Backbone'],
function(_, Backbone){
var UserRegistration = Backbone.Model.extend({
url: '/users/reg',
paramRoot: 'user',
defaults: {
'fullname': '',
'email': '',
'password': ''
}
});
return UserRegistration;
});
会是什么,下一步,使其后到我的REST后端服务器?