30 lines
		
	
	
		
			829 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
		
		
			
		
	
	
			30 lines
		
	
	
		
			829 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
|  | declare var angular: angular.IAngularStatic; | ||
|  | // #docregion ngmodule
 | ||
|  | import { NgModule } from '@angular/core'; | ||
|  | import { BrowserModule } from '@angular/platform-browser'; | ||
|  | import { UpgradeModule } from '@angular/upgrade/static'; | ||
|  | 
 | ||
|  | @NgModule({ | ||
|  |   imports: [ | ||
|  |     BrowserModule, | ||
|  |     UpgradeModule | ||
|  |   ] | ||
|  | }) | ||
|  | export class AppModule { | ||
|  |   ngDoBootstrap() {} | ||
|  | } | ||
|  | // #enddocregion ngmodule
 | ||
|  | angular.module('heroApp', []) | ||
|  |   .controller('MainCtrl', function() { | ||
|  |     this.message = 'Hello world'; | ||
|  |   }); | ||
|  | 
 | ||
|  | // #docregion bootstrap
 | ||
|  | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; | ||
|  | 
 | ||
|  | platformBrowserDynamic().bootstrapModule(AppModule).then(platformRef => { | ||
|  |   const upgrade = platformRef.injector.get(UpgradeModule) as UpgradeModule; | ||
|  |   upgrade.bootstrap(document.body, ['heroApp'], {strictDi: true}); | ||
|  | }); | ||
|  | // #enddocregion bootstrap
 |