Determine if an object property is ko.observable

前端 未结 4 853
时光取名叫无心
时光取名叫无心 2020-12-24 11:17

I\'m using KnockoutJS version 2.0.0

If I\'m looping through all properties of an object, how can I test whether each property is a ko.observable? Here\

4条回答
  •  青春惊慌失措
    2020-12-24 11:54

    Knockout has the following function which I think is what you are looking for:

    ko.isObservable(vm[key])
    

提交回复
热议问题