Explain what is the custom element lifecycle in Polymer.js?

devquora
devquora

Posted On: Feb 22, 2018

 

Custom elements provide a component model for the web. The custom element specifications offer a set of callbacks, which are known as “custom element reactions”. These allow you to run user code in response to certain lifecycle changes. Some of the reactions, which allow making changes in elements and their descriptions are listed as follows:

  • Constructor: This is called when the element is upgraded (that is, when an element is created, or when a previously-created element becomes defined).
  • ConnectedCallback: This is called when the element is added to a document.
  • DisconnectedCallback: This is called when the element is removed from a document.
  • AttributeChangedCallback: This is called when any of the element’s attributes are changed, appended, removed, or replaced.

    Related Questions

    Please Login or Register to leave a response.

    Related Questions

    PolymerJs Interview Questions

    What is Polymer.js?

    It is an open source JavaScript library, which is chiefly developed by Google. It is mostly used to develop web applicat..

    PolymerJs Interview Questions

    What are the features of Polymer.js?

    Polymer JS is currently the simplest way to create custom HTML elements for API development because this library is buil..

    PolymerJs Interview Questions

    Describe the Architecture Of Polymer.js?

    The architecture of Polymer.js is divided into four important layers which are explained below:Native Layer: It repres..