From abc77a6a39ca151a8e236e755aa3371286add135 Mon Sep 17 00:00:00 2001 From: Paul Gschwendtner Date: Mon, 7 Jun 2021 21:03:42 +0200 Subject: [PATCH] refactor(router): ensure compatibility with noImplicitOverride (#42512) Adds the `override` keyword to the `router` sources to ensure compatibility with `noImplicitOverride`. PR Close #42512 --- packages/router/src/events.ts | 18 +++++++++--------- packages/router/src/router_state.ts | 4 ++-- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/packages/router/src/events.ts b/packages/router/src/events.ts index 388682567c..5dfae64772 100644 --- a/packages/router/src/events.ts +++ b/packages/router/src/events.ts @@ -100,7 +100,7 @@ export class NavigationStart extends RouterEvent { } /** @docsNotRequired */ - toString(): string { + override toString(): string { return `NavigationStart(id: ${this.id}, url: '${this.url}')`; } } @@ -126,7 +126,7 @@ export class NavigationEnd extends RouterEvent { } /** @docsNotRequired */ - toString(): string { + override toString(): string { return `NavigationEnd(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${ this.urlAfterRedirects}')`; } @@ -155,7 +155,7 @@ export class NavigationCancel extends RouterEvent { } /** @docsNotRequired */ - toString(): string { + override toString(): string { return `NavigationCancel(id: ${this.id}, url: '${this.url}')`; } } @@ -181,7 +181,7 @@ export class NavigationError extends RouterEvent { } /** @docsNotRequired */ - toString(): string { + override toString(): string { return `NavigationError(id: ${this.id}, url: '${this.url}', error: ${this.error})`; } } @@ -205,7 +205,7 @@ export class RoutesRecognized extends RouterEvent { } /** @docsNotRequired */ - toString(): string { + override toString(): string { return `RoutesRecognized(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${ this.urlAfterRedirects}', state: ${this.state})`; } @@ -231,7 +231,7 @@ export class GuardsCheckStart extends RouterEvent { super(id, url); } - toString(): string { + override toString(): string { return `GuardsCheckStart(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${ this.urlAfterRedirects}', state: ${this.state})`; } @@ -259,7 +259,7 @@ export class GuardsCheckEnd extends RouterEvent { super(id, url); } - toString(): string { + override toString(): string { return `GuardsCheckEnd(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${ this.urlAfterRedirects}', state: ${this.state}, shouldActivate: ${this.shouldActivate})`; } @@ -288,7 +288,7 @@ export class ResolveStart extends RouterEvent { super(id, url); } - toString(): string { + override toString(): string { return `ResolveStart(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${ this.urlAfterRedirects}', state: ${this.state})`; } @@ -313,7 +313,7 @@ export class ResolveEnd extends RouterEvent { super(id, url); } - toString(): string { + override toString(): string { return `ResolveEnd(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${ this.urlAfterRedirects}', state: ${this.state})`; } diff --git a/packages/router/src/router_state.ts b/packages/router/src/router_state.ts index 21f8d339b8..40ee95402f 100644 --- a/packages/router/src/router_state.ts +++ b/packages/router/src/router_state.ts @@ -59,7 +59,7 @@ export class RouterState extends Tree { setRouterState(this, root); } - toString(): string { + override toString(): string { return this.snapshot.toString(); } } @@ -421,7 +421,7 @@ export class RouterStateSnapshot extends Tree { setRouterState(this, root); } - toString(): string { + override toString(): string { return serializeNode(this._root); } }