Last active
December 18, 2018 10:21
-
-
Save lukasborawski/2a839401663a7f920119a6b2e0e7f4c3 to your computer and use it in GitHub Desktop.
Angular 2 DOM Mutation Observer with Event Emmiter
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
observeDOMChanges() { | |
this.observer = new MutationObserver(mutations => { | |
mutations.forEach(function(mutation) { | |
EventEmmiter.emit(true) | |
}); | |
}); | |
var config = { attributes: true, childList: true, characterData: true }; | |
this.observer.observe(this.elRef.nativeElement, config); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment