refactor: change provide(...) for {provide: ...}

- provide() is deprecated,
- {} syntax is required by the offline compiler
This commit is contained in:
Victor Berchet
2016-06-02 17:30:40 -07:00
parent 27a47e7841
commit a6ad61d83e
128 changed files with 676 additions and 728 deletions

View File

@ -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);

View File

@ -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))
*

View File

@ -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';