fix(router): removed unused ApplicationRef dependency (#35642)

As a part of the process of setting up Router providers, we use `ApplicationRef` as a dependency while providing `Router` token. The thing is that `ApplicationRef` is actually unused (all referenced were removed in 5a849829c4 (diff-c0baae5e1df628e1a217e8dc38557fcb)), but it's still listed as dependency. This is causing problems in case `Router` is used as a dependency for factory functions provided as `APP_INITIALIZERS` multi-token (causing cyclic dependency). This commit removes unused `ApplicationRef` dependency in `Router`, so it can be used without causing cyclic dependency issue.

PR Close #35642
This commit is contained in:
Andrew Kushnir 2020-02-23 12:39:09 -08:00 committed by Miško Hevery
parent 737ec52e9d
commit c839c05620
1 changed files with 6 additions and 6 deletions

View File

@ -51,9 +51,9 @@ export const ROUTER_PROVIDERS: Provider[] = [
provide: Router,
useFactory: setupRouter,
deps: [
ApplicationRef, UrlSerializer, ChildrenOutletContexts, Location, Injector,
NgModuleFactoryLoader, Compiler, ROUTES, ROUTER_CONFIGURATION,
[UrlHandlingStrategy, new Optional()], [RouteReuseStrategy, new Optional()]
UrlSerializer, ChildrenOutletContexts, Location, Injector, NgModuleFactoryLoader, Compiler,
ROUTES, ROUTER_CONFIGURATION, [UrlHandlingStrategy, new Optional()],
[RouteReuseStrategy, new Optional()]
]
},
ChildrenOutletContexts,
@ -429,9 +429,9 @@ export interface ExtraOptions {
}
export function setupRouter(
ref: ApplicationRef, urlSerializer: UrlSerializer, contexts: ChildrenOutletContexts,
location: Location, injector: Injector, loader: NgModuleFactoryLoader, compiler: Compiler,
config: Route[][], opts: ExtraOptions = {}, urlHandlingStrategy?: UrlHandlingStrategy,
urlSerializer: UrlSerializer, contexts: ChildrenOutletContexts, location: Location,
injector: Injector, loader: NgModuleFactoryLoader, compiler: Compiler, config: Route[][],
opts: ExtraOptions = {}, urlHandlingStrategy?: UrlHandlingStrategy,
routeReuseStrategy?: RouteReuseStrategy) {
const router = new Router(
null, urlSerializer, contexts, location, injector, loader, compiler, flatten(config));