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

Method createUrlTree

packages/router/src/directives/router_link.ts:569–586  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

567 }
568
569 private createUrlTree(): UrlTree | null {
570 const routerLinkInput = this.routerLinkInput();
571 if (routerLinkInput === null || !this.router.createUrlTree) {
572 return null;
573 } else if (isUrlTree(routerLinkInput)) {
574 return routerLinkInput;
575 }
576 return this.router.createUrlTree(routerLinkInput, {
577 // If the `relativeTo` input is not defined, we want to use `this.route`
578 // by default.
579 // Otherwise, we should use the value provided by the user in the input.
580 relativeTo: this._relativeTo() !== undefined ? this._relativeTo() : this.route,
581 queryParams: this._queryParams(),
582 fragment: this._fragment(),
583 queryParamsHandling: this._queryParamsHandling(),
584 preserveFragment: this._preserveFragment(),
585 });
586 }
587
588 get urlTree(): UrlTree | null {
589 return untracked(() => this.createUrlTree());

Callers 2

RouterLinkClass · 0.95
urlTreeMethod · 0.95

Calls 1

isUrlTreeFunction · 0.90

Tested by

no test coverage detected