Two observers Polymer -


i have 2 observers , in each observer change value of property of other observer. in case dont want other observer execute. how can change observer execute in change of property outside?

thanks

your best option use local variable stop update.

polymer({     is: 'my-element',     properties: {         myproperty: {             type: string,             observer: '_myobservera'         }     },     observers: [         '_myobserverb(myproperty)'     ],     _myobservera(newvalue) {         if(!this._localupdate) {             //do stuff here         } else {             this._localupdate = false;         }     },     _myobserverb(newvalue) {         this._localupdate = true;         //do stuff here     } }) 

Comments

Popular posts from this blog

java - Date formats difference between yyyy-MM-dd'T'HH:mm:ss and yyyy-MM-dd'T'HH:mm:ssXXX -

c# - Get rid of xmlns attribute when adding node to existing xml -