在淘汰赛中,这可以正常工作并正确绑定:
self.currentCustomer = ko.observable(new Customer("a","b","c","d","e","f","g","h"));
但是,下面没有。
// Random list of customers
self.customers = ko.observableArray([
new Customer("a","b","c","d","e","f","g","h")
]);
self.currentCustomer = ko.observable(self.customers[0]);
我无法弄清楚为什么这不起作用。这种模式在我的应用程序的其他部分中正常工作。