MCPcopy Create free account
hub / github.com/angular/components / ngAfterViewChecked

Method ngAfterViewChecked

src/material/icon/icon.ts:295–312  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

293 }
294
295 ngAfterViewChecked() {
296 const cachedElements = this._elementsWithExternalReferences;
297
298 if (cachedElements && cachedElements.size) {
299 const newPath = this._location.getPathname();
300
301 // We need to check whether the URL has changed on each change detection since
302 // the browser doesn't have an API that will let us react on link clicks and
303 // we can't depend on the Angular router. The references need to be updated,
304 // because while most browsers don't care whether the URL is correct after
305 // the first render, Safari will break if the user navigates to a different
306 // page and the SVG isn't re-rendered.
307 if (newPath !== this._previousPath) {
308 this._previousPath = newPath;
309 this._prependPathToReferences(newPath);
310 }
311 }
312 }
313
314 ngOnDestroy() {
315 this._currentIconFetch.unsubscribe();

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected