2017-02-22 18:13:21 +00:00
|
|
|
declare var angular: angular.IAngularStatic;
|
|
|
|
import { NgModule } from '@angular/core';
|
|
|
|
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
|
|
|
|
import { BrowserModule } from '@angular/platform-browser';
|
|
|
|
import { UpgradeModule, downgradeComponent } from '@angular/upgrade/static';
|
|
|
|
|
|
|
|
import { heroDetail, HeroDetailDirective } from './hero-detail.component';
|
|
|
|
import { ContainerComponent } from './container.component';
|
|
|
|
|
|
|
|
// #docregion heroupgrade
|
|
|
|
@NgModule({
|
|
|
|
imports: [
|
|
|
|
BrowserModule,
|
|
|
|
UpgradeModule
|
|
|
|
],
|
|
|
|
declarations: [
|
|
|
|
ContainerComponent,
|
|
|
|
HeroDetailDirective
|
|
|
|
],
|
|
|
|
entryComponents: [
|
|
|
|
ContainerComponent
|
|
|
|
]
|
|
|
|
})
|
|
|
|
export class AppModule {
|
2017-05-18 10:48:05 +03:00
|
|
|
constructor(private upgrade: UpgradeModule) { }
|
|
|
|
ngDoBootstrap() {
|
|
|
|
this.upgrade.bootstrap(document.body, ['heroApp'], { strictDi: true });
|
|
|
|
}
|
2017-02-22 18:13:21 +00:00
|
|
|
}
|
|
|
|
// #enddocregion heroupgrade
|
|
|
|
|
|
|
|
angular.module('heroApp', [])
|
|
|
|
.component('heroDetail', heroDetail)
|
|
|
|
.directive(
|
|
|
|
'myContainer',
|
|
|
|
downgradeComponent({component: ContainerComponent}) as angular.IDirectiveFactory
|
|
|
|
);
|
|
|
|
|
2017-05-18 10:48:05 +03:00
|
|
|
platformBrowserDynamic().bootstrapModule(AppModule);
|