MCPcopy
hub / github.com/angular/angular / parseUrl

Method parseUrl

packages/router/src/router.ts:592–604  ·  view source on GitHub ↗

Parses a string into a `UrlTree`

(url: string)

Source from the content-addressed store, hash-verified

590
591 /** Parses a string into a `UrlTree` */
592 parseUrl(url: string): UrlTree {
593 try {
594 return this.urlSerializer.parse(url);
595 } catch (e) {
596 this.console.warn(
597 formatRuntimeError(
598 RuntimeErrorCode.ERROR_PARSING_URL,
599 ngDevMode && `Error parsing URL ${url}. Falling back to '/' instead. \n` + e,
600 ),
601 );
602 return this.urlSerializer.parse('/');
603 }
604 }
605
606 /**
607 * Returns whether the url is activated.

Calls 3

formatRuntimeErrorFunction · 0.85
parseMethod · 0.65
warnMethod · 0.65

Tested by 6

isLoggedInGuardFunction · 0.36
constructorMethod · 0.36
guardsIntegrationSuiteFunction · 0.36
returnUrlTreeFunction · 0.36