@ -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;
|
||||
|
@ -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();
|
||||
|
Reference in New Issue
Block a user