fix(ngUpgrade): to work with @NgModule

We changed the bootstrap order:
1. create NgZone
2. bootstrap ng1 inside NgZone and upgrade ng1 components to ng2 components.
3. bootstrap ng2 with NgZone

Note: Previous footgun behavior was: bootstrap ng2 first to extract NgZone, so that ng1 bootstrap can happen in NgZone. This meant that if ng2 bootstrap eagerly compiled a component which contained ng1 components, then we did not have complete metadata.
This commit is contained in:
Igor Minar
2016-08-05 13:32:04 -07:00
committed by Misko Hevery
parent 37f138e83d
commit d21331e902
7 changed files with 179 additions and 85 deletions

View File

@ -1,6 +1,7 @@
/** @experimental */
export declare class UpgradeAdapter {
addProvider(provider: Type | Provider | any[] | any): void;
constructor(ng2AppModule?: Type);
/** @deprecated */ addProvider(provider: Type | Provider | any[] | any): void;
bootstrap(element: Element, modules?: any[], config?: angular.IAngularBootstrapConfig): UpgradeAdapterRef;
downgradeNg2Component(type: Type): Function;
downgradeNg2Provider(token: any): Function;