我正在尝试在 javascript 中创建一个类。
define(['knockout', 'knockout-validation', 'jquery'], function(ko, validation, $) {
var SignUpViewModel = {
name: ko.observable().extend({
required: true
}),
email: ko.observable().extend({
required: true,
email: true
}),
password: ko.observable().extend({
required: true
}),
confirmPassword: ko.observable().extend({
areSame: {
params: password,
message: "Repeat password must match Password"
}
}), // this line contains error .
register: function() {}
}
return SignUpViewModel;
});
现在它给出undefined
密码错误
提前致谢。