refactor: change provide(...) for {provide: ...}
- provide() is deprecated, - {} syntax is required by the offline compiler
This commit is contained in:
@ -58,9 +58,9 @@ export class RouterOutlet implements OnDestroy {
|
||||
var childRouter = this._parentRouter.childRouter(componentType);
|
||||
|
||||
var providers = ReflectiveInjector.resolve([
|
||||
provide(RouteData, {useValue: nextInstruction.routeData}),
|
||||
provide(RouteParams, {useValue: new RouteParams(nextInstruction.params)}),
|
||||
provide(routerMod.Router, {useValue: childRouter})
|
||||
{provide: RouteData, useValue: nextInstruction.routeData},
|
||||
{provide: RouteParams, useValue: new RouteParams(nextInstruction.params)},
|
||||
{provide: routerMod.Router, useValue: childRouter}
|
||||
]);
|
||||
this._componentRef =
|
||||
this._loader.loadNextToLocation(componentType, this._viewContainerRef, providers);
|
||||
|
@ -1,10 +1,9 @@
|
||||
import {ROUTER_PROVIDERS_COMMON} from './router_providers_common';
|
||||
import {Provider} from '@angular/core';
|
||||
import {BrowserPlatformLocation} from '@angular/platform-browser';
|
||||
import {PlatformLocation} from '@angular/common';
|
||||
|
||||
/**
|
||||
* A list of {@link Provider}s. To use the router, you must add this to your application.
|
||||
* A list of providers. To use the router, you must add this to your application.
|
||||
*
|
||||
* ### Example ([live demo](http://plnkr.co/edit/iRUP8B5OUbxCWQ3AcIDm))
|
||||
*
|
||||
|
@ -1,4 +1,4 @@
|
||||
import {ApplicationRef, Provider} from '@angular/core';
|
||||
import {ApplicationRef} from '@angular/core';
|
||||
import {LocationStrategy, PathLocationStrategy, Location} from '@angular/common';
|
||||
import {Router, RootRouter} from './router';
|
||||
import {RouteRegistry, ROUTER_PRIMARY_COMPONENT} from './route_registry';
|
||||
|
Reference in New Issue
Block a user