简体   繁体   中英

KnockoutJS - dependenant observables or computed observables

Is there any difference between dependenant observables and computed observables in KnockoutJS ?

My understanding is that computed observables are successors to dependent observables (basically just different name in the newer versions of Knockout) - but some of the tutorials on the web use one and some use the other.

Can someone answer this once and for all?

Same thing, the name was changed in knockout 2.0. Older examples may use the old name.

See: http://knockoutjs.com/documentation/dependentObservables.html

From Knockout's documentation:

At runtime, ko.dependentObservable refers to the same function as ko.computed, so your existing code will continue to work just fine.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM