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
Post a Comment