projects/ngx-observers/src/lib/mutation.directive.ts
MutationDirective
Allow observe DOM tree changes
Example:
<div (obsMutation)="mutate($event)" [obsOptions]="{subtree: false}" #elem="directive">...</div>
Selector | [obsMutation] |
Properties |
Inputs |
Outputs |
obsOptions |
Type : MutationObserverInit
|
Default value : {}
|
Observer options input You can pass original observer options via [obsOptions] input, to configure observer behaviour. Detailed information can be found: https://developer.mozilla.org/en-US/docs/Web/API/MutationObserver/observe |
obsMutation |
Type : EventEmitter
|
obsMutation output Emits array of MutationRecord objects, describing each change that occurred. Detailed information can be found: https://developer.mozilla.org/en-US/docs/Web/API/MutationObserver/MutationObserver |
observer |
Type : MutationObserver | undefined
|
Original observer object You can access observer within your controller using @ViewChild Example:
Detailed information can be found: https://developer.mozilla.org/en-US/docs/Web/API/MutationObserver/MutationObserver |