0
我想在WinJS.Binding.List投影(例如createFiltered)上使用原型方法。WinJS.Binding.List投影原型
例子:
WinJS.Binding.List.prototype.shoutLength = function() {
console.log("MY LENGTH IS " + this.length);
}
var list = new WinJS.Binding.List([2,1,3]);
var filtered = list.createFiltered(function (item) { return item <= 2; });
list.length; // outputs 3
filtered.length; // outputs 2
list.shoutLength(); // works
filtered.shoutLength(); // doesn't work (Object doesn't support property or method 'shoutLength')
我能夠把這些原型,使其在濾波投影工作,分類預測,分組預測等?