Mutation Observer not working properly with Angular based website

Viewed 590

I'm listening for child node insertions, it is working on first page instance, but when I open another page (identical), the mutation observer is not dispatching any mutations even though nodes are inserted.

I can see visually in Devtools, the nodes are appended, but mutation observer is not detecting those insertions.

This is strange behavior. I've already used mutation observer on different websites, and it works perfectly for me.

screenshot

const target = document.querySelector("#cards-list-loads");

observer = new MutationObserver(searchWatcher);
observer.observe(target, {childList: true, subtree: true});
console.log('Observer attached');
0 Answers
Related