feat(di): change the params of Provider and provide to start with "use"
Closes #4684
This commit is contained in:
@ -30,7 +30,7 @@ import {OpaqueToken, Injectable, Optional, Inject} from 'angular2/angular2';
|
||||
* bootstrap(AppCmp, [
|
||||
* ROUTER_PROVIDERS,
|
||||
* PathLocationStrategy,
|
||||
* provide(APP_BASE_HREF, {asValue: '/my/app'})
|
||||
* provide(APP_BASE_HREF, {useValue: '/my/app'})
|
||||
* ]);
|
||||
* ```
|
||||
*/
|
||||
|
@ -44,7 +44,7 @@ import {LocationStrategy} from './location_strategy';
|
||||
*
|
||||
* bootstrap(AppCmp, [
|
||||
* ROUTER_PROVIDERS, // includes binding to PathLocationStrategy
|
||||
* provide(APP_BASE_HREF, {asValue: '/my/app'})
|
||||
* provide(APP_BASE_HREF, {useValue: '/my/app'})
|
||||
* ]);
|
||||
* ```
|
||||
*/
|
||||
|
@ -58,9 +58,9 @@ export class RouterOutlet {
|
||||
var childRouter = this._parentRouter.childRouter(componentType);
|
||||
|
||||
var providers = Injector.resolve([
|
||||
provide(ROUTE_DATA, {asValue: nextInstruction.routeData()}),
|
||||
provide(RouteParams, {asValue: new RouteParams(nextInstruction.params)}),
|
||||
provide(routerMod.Router, {asValue: childRouter})
|
||||
provide(ROUTE_DATA, {useValue: nextInstruction.routeData()}),
|
||||
provide(RouteParams, {useValue: new RouteParams(nextInstruction.params)}),
|
||||
provide(routerMod.Router, {useValue: childRouter})
|
||||
]);
|
||||
return this._loader.loadNextToLocation(componentType, this._elementRef, providers)
|
||||
.then((componentRef) => {
|
||||
|
Reference in New Issue
Block a user