Use MutationObserver
through an Ember Modifier
- Ember.js v3.12 or above
- Ember CLI v2.13 or above
- Node.js v10 or above
ember install ember-mutation-observer-modifier
This addon provides an Ember modifier for attaching a MutationObserver
to an element in your Ember template and calling an action when the observer fires. All configuration options supported by MutationObserver#observe
are supported through the modifier.
In the following example, this.onChange
will be called any time that this.someAttrValue
is changed on the div
, by observing the changes to the some-attr
attribute.
Note that options for the MutationObserver
can also be provided as the second positional parameter to the modifier.
Please consult the documentation for MutationObserverInit
for a full list of supported parameters.
See the Contributing guide for details.
This project is licensed under the MIT License.