Overriding a polymer element at runtime

I am trying to change the definition of a Polymer element at runtime. I tried to simply re-register the item, but I get an error that a component with this name already exists.

Any help on how to override an element during workout is appreciated

+3


source to share


1 answer


To "manipulate DOM, properties and behavior", as Sergey mentions, you can use the built-in callback ready

as described here .



<script>
  (function() {
    Polymer({
      is: 'example-element',
      properties: {...},
      ready: function() {
        // access a local DOM element by ID using this.$
        this.$.header.textContent = 'Hello!';
      }
    });
  })();
</script>

      

+4


source







All Articles