feat(di): rename Binding into Provider

Closes #4416

Closes #4654
This commit is contained in:
vsavkin
2015-10-10 22:11:13 -07:00
committed by Victor Savkin
parent 7c6130c2c5
commit 1eb0162cde
190 changed files with 2071 additions and 1816 deletions

View File

@ -1,5 +1,6 @@
import {
bind,
provide,
AppViewManager,
ChangeDetectorRef,
HostViewRef,
@ -38,8 +39,8 @@ export class Ng2ComponentFacade {
}
bootstrapNg2() {
var childInjector =
this.parentInjector.resolveAndCreateChild([bind(NG1_SCOPE).toValue(this.componentScope)]);
var childInjector = this.parentInjector.resolveAndCreateChild(
[provide(NG1_SCOPE, {asValue: this.componentScope})]);
this.hostViewRef =
this.viewManager.createRootHostView(this.protoView, '#' + this.id, childInjector);
var renderer: any = (<any>this.hostViewRef).render;

View File

@ -2,6 +2,7 @@
import {
bind,
provide,
platform,
ApplicationRef,
AppViewManager,
@ -14,7 +15,7 @@ import {
} from 'angular2/angular2';
import {applicationDomBindings} from 'angular2/src/core/application_common';
import {applicationCommonBindings} from 'angular2/src/core/application_ref';
import {compilerBindings} from 'angular2/src/core/compiler/compiler';
import {compilerProviders} from 'angular2/src/core/compiler/compiler';
import {getComponentInfo, ComponentInfo} from './metadata';
import {onError} from './util';
@ -71,9 +72,9 @@ export class UpgradeModule {
var bindings = [
applicationCommonBindings(),
applicationDomBindings(),
compilerBindings(),
bind(NG1_INJECTOR).toFactory(() => ng1Injector),
bind(NG1_COMPILE).toFactory(() => ng1Injector.get(NG1_COMPILE))
compilerProviders(),
provide(NG1_INJECTOR, {asFactory: () => ng1Injector}),
provide(NG1_COMPILE, {asFactory: () => ng1Injector.get(NG1_COMPILE)})
];
var platformRef: PlatformRef = platform();