refactor: fix undecorated classes with angular features in repo (#36921)

A few instances of undecorated classes with Angular features
have been discovered in the framework repo. This commit fixes
those.

PR Close #36921
This commit is contained in:
Paul Gschwendtner
2020-05-05 16:47:14 +02:00
committed by Alex Rickabaugh
parent 0577bf0e3e
commit e17fe90aaa
6 changed files with 15 additions and 8 deletions

View File

@ -7,8 +7,8 @@
*/
import {Location} from '@angular/common';
import {Compiler, Injector, isDevMode, NgModuleFactoryLoader, NgModuleRef, NgZone, Type, ɵConsole as Console} from '@angular/core';
import {BehaviorSubject, defer, EMPTY, Observable, of, Subject, Subscription} from 'rxjs';
import {Compiler, Injectable, Injector, isDevMode, NgModuleFactoryLoader, NgModuleRef, NgZone, Type, ɵConsole as Console} from '@angular/core';
import {BehaviorSubject, EMPTY, Observable, of, Subject, Subscription} from 'rxjs';
import {catchError, filter, finalize, map, switchMap, tap} from 'rxjs/operators';
import {QueryParamsHandling, Route, Routes, standardizeConfig, validateConfig} from './config';
@ -288,6 +288,7 @@ function defaultRouterHook(snapshot: RouterStateSnapshot, runExtras: {
*
* @publicApi
*/
@Injectable()
export class Router {
private currentUrlTree: UrlTree;
private rawUrlTree: UrlTree;

View File

@ -7,12 +7,13 @@
*/
import {ViewportScroller} from '@angular/common';
import {OnDestroy} from '@angular/core';
import {Injectable, OnDestroy} from '@angular/core';
import {Unsubscribable} from 'rxjs';
import {NavigationEnd, NavigationStart, Scroll} from './events';
import {Router} from './router';
@Injectable()
export class RouterScroller implements OnDestroy {
// TODO(issue/24571): remove '!'.
private routerEventsSubscription!: Unsubscribable;