Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 0 additions & 19 deletions goldens/public-api/router/index.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ export class ActivationEnd {
snapshot: ActivatedRouteSnapshot);
// (undocumented)
snapshot: ActivatedRouteSnapshot;
// (undocumented)
toString(): string;
// (undocumented)
readonly type = EventType.ActivationEnd;
Expand All @@ -96,7 +95,6 @@ export class ActivationStart {
snapshot: ActivatedRouteSnapshot);
// (undocumented)
snapshot: ActivatedRouteSnapshot;
// (undocumented)
toString(): string;
// (undocumented)
readonly type = EventType.ActivationStart;
Expand Down Expand Up @@ -163,7 +161,6 @@ export class ChildActivationEnd {
snapshot: ActivatedRouteSnapshot);
// (undocumented)
snapshot: ActivatedRouteSnapshot;
// (undocumented)
toString(): string;
// (undocumented)
readonly type = EventType.ChildActivationEnd;
Expand All @@ -175,7 +172,6 @@ export class ChildActivationStart {
snapshot: ActivatedRouteSnapshot);
// (undocumented)
snapshot: ActivatedRouteSnapshot;
// (undocumented)
toString(): string;
// (undocumented)
readonly type = EventType.ChildActivationStart;
Expand Down Expand Up @@ -329,7 +325,6 @@ export class GuardsCheckEnd extends RouterEvent {
shouldActivate: boolean;
// (undocumented)
state: RouterStateSnapshot;
// (undocumented)
toString(): string;
// (undocumented)
readonly type = EventType.GuardsCheckEnd;
Expand All @@ -346,7 +341,6 @@ export class GuardsCheckStart extends RouterEvent {
state: RouterStateSnapshot);
// (undocumented)
state: RouterStateSnapshot;
// (undocumented)
toString(): string;
// (undocumented)
readonly type = EventType.GuardsCheckStart;
Expand Down Expand Up @@ -438,7 +432,6 @@ export class NavigationCancel extends RouterEvent {
code?: NavigationCancellationCode | undefined);
readonly code?: NavigationCancellationCode | undefined;
reason: string;
// (undocumented)
toString(): string;
// (undocumented)
readonly type = EventType.NavigationCancel;
Expand All @@ -459,7 +452,6 @@ export class NavigationEnd extends RouterEvent {
id: number,
url: string,
urlAfterRedirects: string);
// (undocumented)
toString(): string;
// (undocumented)
readonly type = EventType.NavigationEnd;
Expand All @@ -477,7 +469,6 @@ export class NavigationError extends RouterEvent {
// (undocumented)
error: any;
readonly target?: RouterStateSnapshot | undefined;
// (undocumented)
toString(): string;
// (undocumented)
readonly type = EventType.NavigationError;
Expand Down Expand Up @@ -524,7 +515,6 @@ export class NavigationStart extends RouterEvent {
[k: string]: any;
navigationId: number;
} | null;
// (undocumented)
toString(): string;
// (undocumented)
readonly type = EventType.NavigationStart;
Expand Down Expand Up @@ -637,7 +627,6 @@ export class ResolveEnd extends RouterEvent {
state: RouterStateSnapshot);
// (undocumented)
state: RouterStateSnapshot;
// (undocumented)
toString(): string;
// (undocumented)
readonly type = EventType.ResolveEnd;
Expand All @@ -657,7 +646,6 @@ export class ResolveStart extends RouterEvent {
state: RouterStateSnapshot);
// (undocumented)
state: RouterStateSnapshot;
// (undocumented)
toString(): string;
// (undocumented)
readonly type = EventType.ResolveStart;
Expand Down Expand Up @@ -695,7 +683,6 @@ export class RouteConfigLoadEnd {
route: Route);
// (undocumented)
route: Route;
// (undocumented)
toString(): string;
// (undocumented)
readonly type = EventType.RouteConfigLoadEnd;
Expand All @@ -707,7 +694,6 @@ export class RouteConfigLoadStart {
route: Route);
// (undocumented)
route: Route;
// (undocumented)
toString(): string;
// (undocumented)
readonly type = EventType.RouteConfigLoadStart;
Expand Down Expand Up @@ -999,7 +985,6 @@ export class RoutesRecognized extends RouterEvent {
state: RouterStateSnapshot);
// (undocumented)
state: RouterStateSnapshot;
// (undocumented)
toString(): string;
// (undocumented)
readonly type = EventType.RoutesRecognized;
Expand All @@ -1025,7 +1010,6 @@ export class Scroll {
readonly routerEvent: NavigationEnd | NavigationSkipped;
// (undocumented)
readonly scrollBehavior?: "manual" | "after-transition" | undefined;
// (undocumented)
toString(): string;
// (undocumented)
readonly type = EventType.Scroll;
Expand Down Expand Up @@ -1087,7 +1071,6 @@ export class UrlSegment {
[name: string]: string;
};
path: string;
// (undocumented)
toString(): string;
}

Expand All @@ -1105,7 +1088,6 @@ export class UrlSegmentGroup {
get numberOfChildren(): number;
parent: UrlSegmentGroup | null;
segments: UrlSegment[];
// (undocumented)
toString(): string;
}

Expand All @@ -1130,7 +1112,6 @@ export class UrlTree {
get queryParamMap(): ParamMap;
queryParams: Params;
root: UrlSegmentGroup;
// (undocumented)
toString(): string;
}

Expand Down
29 changes: 23 additions & 6 deletions packages/router/src/events.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
*/

import {NavigationBehaviorOptions, Route} from './models';
import type {Navigation} from './navigation_transition';
import {ActivatedRouteSnapshot, RouterStateSnapshot} from './router_state';
import {UrlTree} from './url_tree';
import type {Navigation} from './navigation_transition';

/**
* Identifies the call or event that triggered a navigation.
Expand Down Expand Up @@ -135,7 +135,7 @@ export class NavigationStart extends RouterEvent {
this.restoredState = restoredState;
}

/** @docsNotRequired */
/** @docs-private */
override toString(): string {
return `NavigationStart(id: ${this.id}, url: '${this.url}')`;
}
Expand Down Expand Up @@ -164,7 +164,7 @@ export class NavigationEnd extends RouterEvent {
super(id, url);
}

/** @docsNotRequired */
/** @docs-private */
override toString(): string {
return `NavigationEnd(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}')`;
}
Expand Down Expand Up @@ -255,7 +255,7 @@ export class NavigationCancel extends RouterEvent {
super(id, url);
}

/** @docsNotRequired */
/** @docs-private */
override toString(): string {
return `NavigationCancel(id: ${this.id}, url: '${this.url}')`;
}
Expand Down Expand Up @@ -331,7 +331,7 @@ export class NavigationError extends RouterEvent {
super(id, url);
}

/** @docsNotRequired */
/** @docs-private */
override toString(): string {
return `NavigationError(id: ${this.id}, url: '${this.url}', error: ${this.error})`;
}
Expand All @@ -358,7 +358,7 @@ export class RoutesRecognized extends RouterEvent {
super(id, url);
}

/** @docsNotRequired */
/** @docs-private */
override toString(): string {
return `RoutesRecognized(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`;
}
Expand Down Expand Up @@ -387,6 +387,7 @@ export class GuardsCheckStart extends RouterEvent {
super(id, url);
}

/** @docs-private */
override toString(): string {
return `GuardsCheckStart(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`;
}
Expand Down Expand Up @@ -417,6 +418,7 @@ export class GuardsCheckEnd extends RouterEvent {
super(id, url);
}

/** @docs-private */
override toString(): string {
return `GuardsCheckEnd(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state}, shouldActivate: ${this.shouldActivate})`;
}
Expand Down Expand Up @@ -448,6 +450,7 @@ export class ResolveStart extends RouterEvent {
super(id, url);
}

/** @docs-private */
override toString(): string {
return `ResolveStart(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`;
}
Expand Down Expand Up @@ -475,6 +478,7 @@ export class ResolveEnd extends RouterEvent {
super(id, url);
}

/** @docs-private */
override toString(): string {
return `ResolveEnd(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`;
}
Expand All @@ -494,6 +498,8 @@ export class RouteConfigLoadStart {
/** @docsNotRequired */
public route: Route,
) {}

/** @docs-private */
toString(): string {
return `RouteConfigLoadStart(path: ${this.route.path})`;
}
Expand All @@ -513,6 +519,8 @@ export class RouteConfigLoadEnd {
/** @docsNotRequired */
public route: Route,
) {}

/** @docs-private */
toString(): string {
return `RouteConfigLoadEnd(path: ${this.route.path})`;
}
Expand All @@ -533,6 +541,8 @@ export class ChildActivationStart {
/** @docsNotRequired */
public snapshot: ActivatedRouteSnapshot,
) {}

/** @docs-private */
toString(): string {
const path = (this.snapshot.routeConfig && this.snapshot.routeConfig.path) || '';
return `ChildActivationStart(path: '${path}')`;
Expand All @@ -553,6 +563,8 @@ export class ChildActivationEnd {
/** @docsNotRequired */
public snapshot: ActivatedRouteSnapshot,
) {}

/** @docs-private */
toString(): string {
const path = (this.snapshot.routeConfig && this.snapshot.routeConfig.path) || '';
return `ChildActivationEnd(path: '${path}')`;
Expand All @@ -574,6 +586,8 @@ export class ActivationStart {
/** @docsNotRequired */
public snapshot: ActivatedRouteSnapshot,
) {}

/** @docs-private */
toString(): string {
const path = (this.snapshot.routeConfig && this.snapshot.routeConfig.path) || '';
return `ActivationStart(path: '${path}')`;
Expand All @@ -595,6 +609,8 @@ export class ActivationEnd {
/** @docsNotRequired */
public snapshot: ActivatedRouteSnapshot,
) {}

/** @docs-private */
toString(): string {
const path = (this.snapshot.routeConfig && this.snapshot.routeConfig.path) || '';
return `ActivationEnd(path: '${path}')`;
Expand Down Expand Up @@ -623,6 +639,7 @@ export class Scroll {
readonly scrollBehavior?: 'manual' | 'after-transition',
) {}

/** @docs-private */
toString(): string {
const pos = this.position ? `${this.position[0]}, ${this.position[1]}` : null;
return `Scroll(anchor: '${this.anchor}', position: '${pos}')`;
Expand Down
8 changes: 4 additions & 4 deletions packages/router/src/url_tree.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
import {computed, Injectable, ɵRuntimeError as RuntimeError, Signal} from '@angular/core';

import {RuntimeErrorCode} from './errors';
import type {Router} from './router';
import {convertToParamMap, ParamMap, Params, PRIMARY_OUTLET} from './shared';
import {equalArraysOrString, shallowEqual} from './utils/collection';
import type {Router} from './router';

/**
* A set of options which specify how to determine if a `UrlTree` is active, given the `UrlTree`
Expand Down Expand Up @@ -285,7 +285,7 @@ export class UrlTree {
return this._queryParamMap;
}

/** @docsNotRequired */
/** @docs-private */
toString(): string {
return DEFAULT_SERIALIZER.serialize(this);
}
Expand Down Expand Up @@ -323,7 +323,7 @@ export class UrlSegmentGroup {
return Object.keys(this.children).length;
}

/** @docsNotRequired */
/** @docs-private */
toString(): string {
return serializePaths(this);
}
Expand Down Expand Up @@ -372,7 +372,7 @@ export class UrlSegment {
return this._parameterMap;
}

/** @docsNotRequired */
/** @docs-private */
toString(): string {
return serializePath(this);
}
Expand Down