37 lines
1.0 KiB
TypeScript
Raw Normal View History

2016-11-09 19:05:03 +00:00
declare var angular: any;
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';
2016-11-09 19:05:03 +00:00
import { heroDetail, HeroDetailComponent } from './hero-detail.component';
import { ContainerComponent } from './container.component';
2016-11-09 19:05:03 +00:00
// #docregion heroupgrade
@NgModule({
imports: [
BrowserModule,
UpgradeModule
],
declarations: [
ContainerComponent,
HeroDetailComponent
],
entryComponents: [
ContainerComponent
]
})
export class AppModule {
ngDoBootstrap() {}
}
// #enddocregion heroupgrade
angular.module('heroApp', [])
.component('heroDetail', heroDetail)
2016-11-09 19:05:03 +00:00
.directive('myContainer', downgradeComponent({component: ContainerComponent}));
2016-11-09 19:05:03 +00:00
platformBrowserDynamic().bootstrapModule(AppModule).then(platformRef => {
let upgrade = platformRef.injector.get(UpgradeModule);
upgrade.bootstrap(document.body, ['heroApp'], {strictDi: true});
});