Skip to content

Instantly share code, notes, and snippets.

@lukasborawski
Last active December 18, 2018 10:21
Show Gist options
  • Save lukasborawski/2a839401663a7f920119a6b2e0e7f4c3 to your computer and use it in GitHub Desktop.
Save lukasborawski/2a839401663a7f920119a6b2e0e7f4c3 to your computer and use it in GitHub Desktop.
Angular 2 DOM Mutation Observer with Event Emmiter
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