From 1dffa51808a40e0536ae1a547c37b30741a71e59 Mon Sep 17 00:00:00 2001 From: Paul Gschwendtner Date: Mon, 7 Jun 2021 21:06:06 +0200 Subject: [PATCH] refactor: ensure compatibility with noImplicitOverride for examples (#42512) Adds the `override` keyword to the `examples` sources to ensure compatibility with `noImplicitOverride`. PR Close #42512 --- .../examples/compiler/ts/url_resolver/url_resolver.ts | 2 +- packages/examples/core/di/ts/provider_spec.ts | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/examples/compiler/ts/url_resolver/url_resolver.ts b/packages/examples/compiler/ts/url_resolver/url_resolver.ts index 1024be3a2c..b4ea8a30af 100644 --- a/packages/examples/compiler/ts/url_resolver/url_resolver.ts +++ b/packages/examples/compiler/ts/url_resolver/url_resolver.ts @@ -16,7 +16,7 @@ class MyApp { } class MyUrlResolver extends UrlResolver { - resolve(baseUrl: string, url: string): string { + override resolve(baseUrl: string, url: string): string { // Serve CSS files from a special CDN. if (url.substr(-4) === '.css') { return super.resolve('http://cdn.myapp.com/css/', url); diff --git a/packages/examples/core/di/ts/provider_spec.ts b/packages/examples/core/di/ts/provider_spec.ts index 1bae531f89..8ed044b059 100644 --- a/packages/examples/core/di/ts/provider_spec.ts +++ b/packages/examples/core/di/ts/provider_spec.ts @@ -62,7 +62,7 @@ import {Injectable, InjectionToken, Injector, Optional, ReflectiveInjector} from } class Square extends Shape { - name = 'square'; + override name = 'square'; } const injector = ReflectiveInjector.resolveAndCreate([{provide: Shape, useClass: Square}]); @@ -80,7 +80,7 @@ import {Injectable, InjectionToken, Injector, Optional, ReflectiveInjector} from } class FormalGreeting extends Greeting { - salutation = 'Greetings'; + override salutation = 'Greetings'; } const injector = ReflectiveInjector.resolveAndCreate( @@ -101,7 +101,7 @@ import {Injectable, InjectionToken, Injector, Optional, ReflectiveInjector} from } class Square extends Shape { - name = 'square'; + override name = 'square'; } const injector = @@ -120,7 +120,7 @@ import {Injectable, InjectionToken, Injector, Optional, ReflectiveInjector} from } class FormalGreeting extends Greeting { - salutation = 'Greetings'; + override salutation = 'Greetings'; } const injector = Injector.create({ @@ -161,7 +161,7 @@ import {Injectable, InjectionToken, Injector, Optional, ReflectiveInjector} from } class FormalGreeting extends Greeting { - salutation = 'Greetings'; + override salutation = 'Greetings'; } const injector = Injector.create({