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

Method ngAfterViewChecked

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

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected