我正在尝试自己研究 Ember.js,但遇到了一个问题,我想使用 ajax 函数调用服务器端方法,但它没有按计划工作我可以调用该函数并提醒输入,但无法传递值到服务器端,我当前的代码如下
//Application
App = Em.Application.create();
//Model
App.Users = Em.Object.extend({
EmailID: null,
Password: null
});
//View
App.UserTextField = Em.TextField.extend({
});
App.PassTextField = Em.TextField.extend({
});
//controller
App.AlertController = Em.ObjectController.extend({
content: [],
username: '',
password: '',
alertDetails: function () {
var me = this;
var username = me.get("username");
var pass = me.get("password");
alert(username + ' ' + pass);
var data = App.Users.create({
EmailID: username,
Password: pass,
passData: function () {
$.ajax({
url: '/EmberNewFinal/Home/Create',
dataType: 'json',
type: 'POST',
data: data,
success: function (response) {
alert("hi");
}
});
}
});
}
});
App.alertController = App.AlertController.create();
我找不到我的代码的问题,请帮我找出答案
提前致谢.....