简体   繁体   中英

Detecting variable changes with Aurelia

Can i detect changes to a variable with aurelia?

I am able to detect the change of a type with @observable, but I am innterested in the change in a variables value ex a = 3 to a = 4 -> detect and do magic()

Normaly you can. https://discourse.aurelia.io/t/how-to-observe-objects-in-aurelia-using-the-binding-engine/23

"The propertyObserver doesn't really have many caveats, the only thing you need to be aware of is you can only watch a single property. You can create multiple propertyObserver calls to observe multiple properties, but you cannot observe objects as a whole (as there are no native events fired when they change)"

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