mirror of
https://github.com/Polymer/polymer.git
synced 2026-08-19 01:14:44 -05:00
Add example for flattened-nodes-observer
This commit is contained in:
@@ -44,6 +44,24 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
||||
* `MutationObserver` and the `<slot>` element's `slotchange` event which
|
||||
* are asynchronous.
|
||||
*
|
||||
* An example:
|
||||
* ```js
|
||||
* class TestSelfObserve extends Polymer.Element {
|
||||
* static get is() { return 'test-self-observe';}
|
||||
* connectedCallback() {
|
||||
* super.connectedCallback();
|
||||
* this._observer = new Polymer.FlattenedNodesObserver(this, (info) => {
|
||||
* this.info = info;
|
||||
* });
|
||||
* }
|
||||
* disconnectedCallback() {
|
||||
* super.disconnectedCallback();
|
||||
* this._observer.disconnect();
|
||||
* }
|
||||
* }
|
||||
* customElements.define(TestSelfObserve.is, TestSelfObserve);
|
||||
* ```
|
||||
*
|
||||
* @memberof Polymer
|
||||
* @summary Class that listens for changes (additions or removals) to
|
||||
* "flattened nodes" on a given `node`.
|
||||
|
||||
Reference in New Issue
Block a user