我在结帐页面的控制台中得到此错误和堆栈跟踪,无法继续结帐。
knockout.js:3381 Uncaught ReferenceError: Unable to process binding "if: function(){return customer().fullname }"
Message: customer is not defined
at if (eval at createBindingsStringEvaluator (knockout.js:2982), <anonymous>:3:55)
at ko.computed.dis
我正在从它的官方网站学习knockout,这是我从网站上获取的一个教程
// This is a simple *viewmodel* - JavaScript that defines the data and behavior of your UI
function AppViewModel() {
this.firstName = ko.observable('');
this.lastName = ko.observable("Bertington");
this.fullName = ko.computed(function() {
return th
我正在使用MVC,我正在尝试使用上的入门教程,不过我想在Visual studio中实现它们。我不太确定该怎么做……
所以我创建了一个JS文件:
// This is a simple *viewmodel* - JavaScript that defines the data and behavior of your UI
function AppViewModel() {
this.firstName = "Bert";
this.lastName = "Bertington";
}
// Activates knockout.js
ko.
下面是取自Knockout.js教程站点的代码:
function SeatReservation(name, initialMeal) {
var self = this;
self.name = name;
self.meal = ko.observable(initialMeal);
}
//View Model along with initialState
function ReservationsViewModel() {
var self = this;
//Non-edible data
self.availableMeals = [
{mealName:"s