8/25/2014

Polymer

SPECPOLYMERCALLED WHEN
createdCallbackcreatedAn instance of the element is created.
-readyThe  has been fully prepared (e.g. shadow DOM created, property observers setup, event listeners attached, etc).
attachedCallbackattachedAn instance of the element was inserted into the DOM.
-domReadyCalled when the element’s initial set of children are guaranteed to exist. This is an appropriate time to poke at the element’s parent or light DOM children. Another use is when you have sibling custom elements (e.g. they’re.innerHTML‘d together, at the same time). Before element A can use B’s API/properties, element B needs to be upgraded. The domReady callback ensures both elements exist.
detachedCallbackdetachedAn instance was removed from the DOM.
attributeChangedCallbackattributeChangedAn attribute was added, removed, or updated. Note: to observe changes to published properties, use changed watchers.
Polymer parses element definitions and handles their upgrade asynchronously. If you prematurely fetch the element from the DOM before it has a chance to upgrade, you’ll be working with an HTMLUnknownElement. Polymer elements also support inline resources, such as stylesheets, that need to be loaded. These can causeFOUC issues if they’re not fully loaded prior to rendering an element. To avoid FOUC, Polymer delays registering elements until stylesheets are fully loaded.
To know when elements have been registered/upgraded, and thus ready to be interacted with, use thepolymer-ready event.

   rel="import" href="path/to/x-foo.html">

No comments: