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:
parent
9248ee2c64
commit
a55f581add
|
@ -6,7 +6,7 @@
|
|||
* 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';
|
||||
|
||||
|
@ -24,7 +24,7 @@ export abstract class ViewportScroller {
|
|||
static ɵprov = ɵɵdefineInjectable({
|
||||
token: ViewportScroller,
|
||||
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 {
|
||||
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.
|
||||
|
|
|
@ -19,7 +19,7 @@ describe('BrowserViewportScroller', () => {
|
|||
jasmine.createSpyObj('window', ['history', 'scrollTo', 'pageXOffset', 'pageYOffset']);
|
||||
windowSpy.history.scrollRestoration = 'auto';
|
||||
documentSpy = jasmine.createSpyObj('document', ['getElementById', 'getElementsByName']);
|
||||
scroller = new BrowserViewportScroller(documentSpy, windowSpy, null!);
|
||||
scroller = new BrowserViewportScroller(documentSpy, windowSpy);
|
||||
});
|
||||
|
||||
describe('setHistoryScrollRestoration', () => {
|
||||
|
|
Loading…
Reference in New Issue