For performance reasons, the browsers require you to define the list of attributes you want to listen to. You can do that by defining a static method called observedAttributes, which returns an array:
static get observedAttributes() {return ['my-attr', 'another-value']; }
That'll cause attributeChangedCallback to fire for changes to either of the listed attributes.
For performance reasons, the browsers require you to define the list of attributes you want to listen to. You can do that by defining a static method called observedAttributes, which returns an array:
That'll cause attributeChangedCallback to fire for changes to either of the listed attributes.
Thanks a lot. I did get it to work with a setter but i still wanted to know how the callback works. I'll try it out when I can.