我有以下HTML:淘汰賽的foreach不工作
<!-- ko.foreach: properties -->
<span data-bind="text: $data.Name"></span>
<span data-bind="text: $data.Age"></span>
<!-- /ko -->
而且此javascript:
function MyViewModel() {
var self = this;
self.properties = ko.observableArray([
{Name: "John", Age: 32},
{Name: "Steve", Age: 23}
]);
}
ko.applyBindings(new MyViewModel());
這裏的的jsfiddle http://jsfiddle.net/cFB5B/
爲什麼沒有在foreach工作?
什麼? – bwoebi 2013-04-29 15:15:42