37 lines
1023 B
TypeScript
Raw Normal View History

2016-11-10 13:57:45 +00:00
declare var angular: any;
import { NgModule } from '@angular/core';
2016-11-10 13:57:45 +00:00
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { BrowserModule } from '@angular/platform-browser';
2016-11-10 13:57:45 +00:00
import { UpgradeModule, downgradeComponent } from '@angular/upgrade/static';
2016-11-10 13:57:45 +00:00
import { MainController } from './main.controller';
import { HeroDetailComponent } from './hero-detail.component';
@NgModule({
2016-11-10 13:57:45 +00:00
imports: [
BrowserModule,
UpgradeModule
],
declarations: [
HeroDetailComponent
],
entryComponents: [
HeroDetailComponent
]
})
2016-11-10 13:57:45 +00:00
export class AppModule {
ngDoBootstrap() {}
}
angular.module('heroApp', [])
.controller('MainController', MainController)
2016-11-10 13:57:45 +00:00
.directive('heroDetail', downgradeComponent({
component: HeroDetailComponent,
inputs: ['hero']
}));
2016-11-10 13:57:45 +00:00
platformBrowserDynamic().bootstrapModule(AppModule).then(platformRef => {
2016-11-12 11:00:00 +00:00
let upgrade = platformRef.injector.get(UpgradeModule) as UpgradeModule;
2016-11-10 13:57:45 +00:00
upgrade.bootstrap(document.body, ['heroApp'], {strictDi: true});
});