MCPcopy Create free account
hub / github.com/angular/angular / parseUrl

Method parseUrl

packages/router/src/router.ts:600–612  ·  view source on GitHub ↗

Parses a string into a `UrlTree`

(url: string)

Source from the content-addressed store, hash-verified

598
599 /** Parses a string into a `UrlTree` */
600 parseUrl(url: string): UrlTree {
601 try {
602 return this.urlSerializer.parse(url);
603 } catch (e) {
604 this.console.warn(
605 formatRuntimeError(
606 RuntimeErrorCode.ERROR_PARSING_URL,
607 ngDevMode && `Error parsing URL ${url}. Falling back to '/' instead. \n` + e,
608 ),
609 );
610 return this.urlSerializer.parse('/');
611 }
612 }
613
614 /**
615 * Returns whether the url is activated.

Callers 15

navigateByUrlMethod · 0.95
isActiveMethod · 0.95
isLoggedInGuardFunction · 0.45
url_tree.spec.tsFile · 0.45
setupFunction · 0.45
router.spec.tsFile · 0.45

Calls 3

formatRuntimeErrorFunction · 0.85
parseMethod · 0.65
warnMethod · 0.65

Tested by 10

isLoggedInGuardFunction · 0.36
setupFunction · 0.36
ngOnInitMethod · 0.36
ngOnInitMethod · 0.36
constructorMethod · 0.36
constructorMethod · 0.36
guardsIntegrationSuiteFunction · 0.36
returnUrlTreeFunction · 0.36