refactor(router): Remove unused property in `BrowserViewportScroller` (#40241)

The `BrowserViewportScroller` injects but does not use the `ErrorHandler`.
This commit removes the `ErrorHandler` from the constructor.

PR Close #40241
This commit is contained in:
Andrew Scott 2020-12-22 09:34:37 -08:00 committed by Joey Perrott
parent 9248ee2c64
commit a55f581add
2 changed files with 4 additions and 4 deletions

View File

@ -6,7 +6,7 @@
* found in the LICENSE file at https://angular.io/license * found in the LICENSE file at https://angular.io/license
*/ */
import {ErrorHandler, ɵɵdefineInjectable, ɵɵinject} from '@angular/core'; import {ɵɵdefineInjectable, ɵɵinject} from '@angular/core';
import {DOCUMENT} from './dom_tokens'; import {DOCUMENT} from './dom_tokens';
@ -24,7 +24,7 @@ export abstract class ViewportScroller {
static ɵprov = ɵɵdefineInjectable({ static ɵprov = ɵɵdefineInjectable({
token: ViewportScroller, token: ViewportScroller,
providedIn: 'root', providedIn: 'root',
factory: () => new BrowserViewportScroller(ɵɵinject(DOCUMENT), window, ɵɵinject(ErrorHandler)) factory: () => new BrowserViewportScroller(ɵɵinject(DOCUMENT), window)
}); });
/** /**
@ -67,7 +67,7 @@ export abstract class ViewportScroller {
export class BrowserViewportScroller implements ViewportScroller { export class BrowserViewportScroller implements ViewportScroller {
private offset: () => [number, number] = () => [0, 0]; private offset: () => [number, number] = () => [0, 0];
constructor(private document: any, private window: any, private errorHandler: ErrorHandler) {} constructor(private document: any, private window: any) {}
/** /**
* Configures the top offset used when scrolling to an anchor. * Configures the top offset used when scrolling to an anchor.

View File

@ -19,7 +19,7 @@ describe('BrowserViewportScroller', () => {
jasmine.createSpyObj('window', ['history', 'scrollTo', 'pageXOffset', 'pageYOffset']); jasmine.createSpyObj('window', ['history', 'scrollTo', 'pageXOffset', 'pageYOffset']);
windowSpy.history.scrollRestoration = 'auto'; windowSpy.history.scrollRestoration = 'auto';
documentSpy = jasmine.createSpyObj('document', ['getElementById', 'getElementsByName']); documentSpy = jasmine.createSpyObj('document', ['getElementById', 'getElementsByName']);
scroller = new BrowserViewportScroller(documentSpy, windowSpy, null!); scroller = new BrowserViewportScroller(documentSpy, windowSpy);
}); });
describe('setHistoryScrollRestoration', () => { describe('setHistoryScrollRestoration', () => {