我正在使用knockout-2.2.0.js。我有以下型号:计算可观察问题
function Person(name, age, city)
{
this.Name = ko.observable(name);
this.Age = ko.observable(age);
this.City = ko.observable(city);
ko.computed(function(){
//Is there any way to execute this section whenever Name, Age, City any
//of this observable changes without including this.Name, this.Age and
//this.City inside it
}, this).extend({ throttle: 500 });
}
我知道我问是有点怪,但我想知道有没有办法做到这一点?
简答题:不,你想达到什么目的,也许有不同的方法来解决它,而不是黑客捣蛋? – nemesv 2013-03-08 08:01:04
我认为你只需要订阅模型。 – Ohgodwhy 2013-03-08 08:02:15
yaa订阅是好点,但我想使用油门扩展器,我们可以在订阅中使用它吗?因为我不想得到我可观察到的实时变化 – gaurav 2013-03-08 08:03:39