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

Method parseUrl

packages/router/src/router.ts:602–614  ·  view source on GitHub ↗

Parses a string into a `UrlTree`

(url: string)

Source from the content-addressed store, hash-verified

600
601 /** Parses a string into a `UrlTree` */
602 parseUrl(url: string): UrlTree {
603 try {
604 return this.urlSerializer.parse(url);
605 } catch (e) {
606 this.console.warn(
607 formatRuntimeError(
608 RuntimeErrorCode.ERROR_PARSING_URL,
609 ngDevMode && `Error parsing URL ${url}. Falling back to '/' instead. \n` + e,
610 ),
611 );
612 return this.urlSerializer.parse('/');
613 }
614 }
615
616 /**
617 * 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