MCPcopy Index your code
hub / github.com/angular/components / startObserving

Method startObserving

src/aria/private/utils/collection.ts:46–59  ·  view source on GitHub ↗
(element: HTMLElement)

Source from the content-addressed store, hash-verified

44 }
45
46 startObserving(element: HTMLElement) {
47 if (this._observer) {
48 this._observer.disconnect();
49 }
50
51 this._observer = new MutationObserver(mutations => {
52 const hasStructuralChange = mutations.some(m => m.addedNodes.length || m.removedNodes.length);
53 if (hasStructuralChange) {
54 this._version.update(v => v + 1);
55 }
56 });
57
58 this._observer.observe(element, {childList: true, subtree: true});
59 }
60
61 stopObserving() {
62 this._observer?.disconnect();

Callers 11

constructorMethod · 0.80
constructorMethod · 0.80
constructorMethod · 0.80
constructorMethod · 0.80
constructorMethod · 0.80
constructorMethod · 0.80
constructorMethod · 0.80
constructorMethod · 0.80
constructorMethod · 0.80
constructorMethod · 0.80
constructorMethod · 0.80

Calls 3

updateMethod · 0.65
disconnectMethod · 0.45
observeMethod · 0.45

Tested by 1

constructorMethod · 0.64