diff --git a/app/app.component.html b/app/app.component.html
index 9a0fc87..c6766fa 100644
--- a/app/app.component.html
+++ b/app/app.component.html
@@ -1 +1 @@
-
Angular2 quickstart
\ No newline at end of file
+Angular2 component
diff --git a/app/app.module.ts b/app/app.module.ts
index e096758..8d09ff4 100644
--- a/app/app.module.ts
+++ b/app/app.module.ts
@@ -2,10 +2,13 @@ import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { AppComponent } from './app.component';
+import { UpgradeModule } from '@angular/upgrade/static';
@NgModule({
- imports: [ BrowserModule ],
+ imports: [ BrowserModule, UpgradeModule ],
declarations: [ AppComponent ],
- bootstrap: [ AppComponent ]
+ entryComponents: [ AppComponent ]
})
-export class AppModule { }
\ No newline at end of file
+export class AppModule {
+ ngDoBootstrap() {}
+}
diff --git a/app/main.ts b/app/main.ts
index 3d4db6d..91da2d6 100644
--- a/app/main.ts
+++ b/app/main.ts
@@ -1,5 +1,21 @@
-import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
-
-import { AppModule } from './app.module';
-
-platformBrowserDynamic().bootstrapModule(AppModule);
\ No newline at end of file
+import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
+import { UpgradeModule } from '@angular/upgrade/static';
+import { AppModule } from './app.module';
+import { AppComponent } from './app.component';
+
+import { downgradeComponent } from '@angular/upgrade/static';
+
+declare var angular: angular.IAngularStatic;
+let myApp = angular.module('mainApp', [])
+ .directive(
+ 'appComponent',
+ downgradeComponent({component: AppComponent}) as angular.IDirectiveFactory
+ );
+myApp.controller('MainCtrl', function() {
+ this.message = 'Upgrade angularjs to angular'
+});
+
+platformBrowserDynamic().bootstrapModule(AppModule).then(platformRef => {
+ const upgrade = platformRef.injector.get(UpgradeModule) as UpgradeModule;
+ upgrade.bootstrap(document.documentElement, ['mainApp']);
+});
diff --git a/index.html b/index.html
index bf4344f..c7f2a69 100644
--- a/index.html
+++ b/index.html
@@ -6,21 +6,24 @@
+
+
-
-
- Loading...
+
+ {{ mainCtrl.message }}
+
+