尝试将我的数据绑定到要显示的视图模型,但我在控制台中收到此错误消息:
未捕获的异常(js):未捕获的ReferenceError:未定义数据
对于这一行:bindModel(data);
var getList = function () {
Ajax.Get({
Url: ...,
DataToSubmit: {id: properties.Id },
DataType: "json",
OnSuccess: function (roleData, status, jqXHR) {
bindModel(data);
}
});
};
// Binds the main ViewModel
var bindModel = function (data) {
var _self = viewModel;
ko.applyBindings(viewModel, $('#ListView')[0]);
};
var viewModel = {
ListRoleTypes: ko.observableArray([]),
.....
};