diff --git a/spec/hybrid/async_spec.js b/spec/hybrid/async_spec.js
index 90cd37a09..e0d4a3557 100644
--- a/spec/hybrid/async_spec.js
+++ b/spec/hybrid/async_spec.js
@@ -1,32 +1,61 @@
describe('async angular1/2 hybrid using ngUpgrade application', function() {
- beforeEach(function() {
- browser.get('/hybrid');
- });
+ describe('@angular/upgrade/static', function() {
+ beforeEach(function() {
+ browser.get('/upgrade');
+ });
- it('should set browser flag via config', function() {
- expect(browser.ng12Hybrid).toBe(true);
- });
+ it('should set browser flag via config', function() {
+ expect(browser.ng12Hybrid).toBe(true);
+ });
+
+ it('should be able to click buttons and wait for $timeout', function() {
+ var rootBtn = $$('my-app button').first();
+ expect(rootBtn.getText()).toEqual('Click Count: 0');
+ rootBtn.click();
+ expect(rootBtn.getText()).toEqual('Click Count: 1');
+
+ var ng2Btn = $$('ng2 button').first();
+ expect(ng2Btn.getText()).toEqual('Click Count: 0');
+ ng2Btn.click();
+ expect(ng2Btn.getText()).toEqual('Click Count: 1');
+
+ var ng1Btn = $('ng1 button');
+ expect(ng1Btn.getText()).toEqual('Click Count: 0');
+ ng1Btn.click();
+ expect(ng1Btn.getText()).toEqual('Click Count: 1');
+ });
- it('should be able to click buttons and wait for $timeout', function() {
- var rootBtn = $$('my-app button').first();
- expect(rootBtn.getText()).toEqual('Click Count: 0');
- rootBtn.click();
- expect(rootBtn.getText()).toEqual('Click Count: 1');
-
- var ng2Btn = $$('ng2 button').first();
- expect(ng2Btn.getText()).toEqual('Click Count: 0');
- ng2Btn.click();
- expect(ng2Btn.getText()).toEqual('Click Count: 1');
-
- var ng1Btn = $('ng1 button');
- expect(ng1Btn.getText()).toEqual('Click Count: 0');
- ng1Btn.click();
- expect(ng1Btn.getText()).toEqual('Click Count: 1');
+ it('should use the flag on the browser object', function() {
+ browser.ng12Hybrid = false;
+ browser.get('/ng2'); // will time out if Protractor expects hybrid
+ browser.ng12Hybrid = true;
+ });
});
- it('should use the flag on the browser object', function() {
- browser.ng12Hybrid = false;
- browser.get('/ng2'); // will time out if Protractor expects hybrid
- browser.ng12Hybrid = true;
+ describe('@angular/upgrade (not static)', function() {
+ beforeEach(function() {
+ browser.get('/upgrade?no_static');
+ });
+
+ it('should set browser flag via config', function() {
+ expect(browser.ng12Hybrid).toBe(true);
+ });
+
+ it('should be able to click buttons and wait for $timeout', function() {
+ var rootBtn = $$('my-app button').first();
+ expect(rootBtn.getText()).toEqual('Click Count: 0');
+ rootBtn.click();
+ expect(rootBtn.getText()).toEqual('Click Count: 1');
+
+ var ng2Btn = $$('ng2 button').first();
+ expect(ng2Btn.getText()).toEqual('Click Count: 0');
+ ng2Btn.click();
+ expect(ng2Btn.getText()).toEqual('Click Count: 1');
+
+ var ng1Btn = $('ng1 button');
+ expect(ng1Btn.getText()).toEqual('Click Count: 0');
+ ng1Btn.click();
+ expect(ng1Btn.getText()).toEqual('Click Count: 1');
+ });
});
});
diff --git a/testapp/app.css b/testapp/app.css
index 3f524ad66..1725c2314 100644
--- a/testapp/app.css
+++ b/testapp/app.css
@@ -13,8 +13,8 @@ ol {
}
li {
- width: 25%;
- padding: 4%;
+ width: 18%;
+ padding: 3%;
display: block;
text-align: center;
position: absolute;
@@ -22,10 +22,18 @@ li {
margin: auto;
}
-li.left, li.mid {
+li.left {
left: 0;
}
-li.right, li.mid {
+li.left.mid {
+ left: 25%;
+}
+
+li.right {
right: 0;
-}
+}
+
+li.right.mid {
+ right: 25%;
+}
diff --git a/testapp/hybrid/app/main.js b/testapp/hybrid/app/main.js
deleted file mode 100644
index b7b6fe2a6..000000000
--- a/testapp/hybrid/app/main.js
+++ /dev/null
@@ -1,11 +0,0 @@
-"use strict";
-var myApp_1 = require('./myApp');
-var ng2_1 = require('./ng2');
-var ng1_1 = require('./ng1');
-var upgrader_1 = require('./upgrader');
-var ng1module = angular.module('hybridApp', []);
-ng1module.directive('myApp', myApp_1.myApp);
-ng1module.directive('ng2', upgrader_1.adapter.downgradeNg2Component(ng2_1.Ng2Component));
-ng1module.directive('ng1', ng1_1.ng1Dir);
-upgrader_1.adapter.bootstrap(document.body, ['hybridApp']);
-//# sourceMappingURL=main.js.map
\ No newline at end of file
diff --git a/testapp/hybrid/app/main.ts b/testapp/hybrid/app/main.ts
deleted file mode 100644
index 4818f2945..000000000
--- a/testapp/hybrid/app/main.ts
+++ /dev/null
@@ -1,14 +0,0 @@
-import {myApp} from './myApp'
-import {Ng2Component} from './ng2'
-import {ng1Dir} from './ng1'
-import {adapter} from './upgrader';
-
-declare var angular;
-
-var ng1module = angular.module('hybridApp', []);
-
-ng1module.directive('myApp', myApp);
-ng1module.directive('ng2', adapter.downgradeNg2Component(Ng2Component));
-ng1module.directive('ng1', ng1Dir);
-
-adapter.bootstrap(document.body, ['hybridApp']);
diff --git a/testapp/hybrid/app/myApp.js.map b/testapp/hybrid/app/myApp.js.map
deleted file mode 100644
index 906313ba7..000000000
--- a/testapp/hybrid/app/myApp.js.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"myApp.js","sourceRoot":"","sources":["myApp.ts"],"names":[],"mappings":";AAAA,cAAc,MAAW,EAAE,QAAa;IACtC,MAAM,CAAC,SAAS,GAAG,CAAC,CAAC;IAErB,MAAM,CAAC,WAAW,GAAG;QACnB,QAAQ,CAAC;YACP,MAAM,CAAC,SAAS,EAAE,CAAC;QACrB,CAAC,EAAE,IAAI,CAAC,CAAC;IACX,CAAC,CAAC;AACJ,CAAC;AAED;IACE,MAAM,CAAC;QACL,KAAK,EAAE,EAAE;QACT,WAAW,EAAE,mBAAmB;QAChC,UAAU,EAAE,IAAI;QAChB,YAAY,EAAE,MAAM;KACrB,CAAC;AACJ,CAAC;AAPe,aAAK,QAOpB,CAAA"}
\ No newline at end of file
diff --git a/testapp/hybrid/app/ng1.js b/testapp/hybrid/app/ng1.js
deleted file mode 100644
index 69bf4164a..000000000
--- a/testapp/hybrid/app/ng1.js
+++ /dev/null
@@ -1,19 +0,0 @@
-"use strict";
-function ctrl($scope, $timeout) {
- $scope.callCount = 0;
- $scope.clickButton = function () {
- $timeout(function () {
- $scope.callCount++;
- }, 1000);
- };
-}
-function ng1Dir() {
- return {
- scope: {},
- templateUrl: './html/ng1.html',
- controller: ctrl,
- controllerAs: 'ctrl'
- };
-}
-exports.ng1Dir = ng1Dir;
-//# sourceMappingURL=ng1.js.map
\ No newline at end of file
diff --git a/testapp/hybrid/app/ng1.js.map b/testapp/hybrid/app/ng1.js.map
deleted file mode 100644
index 375d56e2b..000000000
--- a/testapp/hybrid/app/ng1.js.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"ng1.js","sourceRoot":"","sources":["ng1.ts"],"names":[],"mappings":";AAAA,cAAc,MAAW,EAAE,QAAa;IACtC,MAAM,CAAC,SAAS,GAAG,CAAC,CAAC;IAErB,MAAM,CAAC,WAAW,GAAG;QACnB,QAAQ,CAAC;YACP,MAAM,CAAC,SAAS,EAAE,CAAC;QACrB,CAAC,EAAE,IAAI,CAAC,CAAC;IACX,CAAC,CAAC;AACJ,CAAC;AAED;IACE,MAAM,CAAC;QACL,KAAK,EAAE,EAAE;QACT,WAAW,EAAE,iBAAiB;QAC9B,UAAU,EAAE,IAAI;QAChB,YAAY,EAAE,MAAM;KACrB,CAAC;AACJ,CAAC;AAPe,cAAM,SAOrB,CAAA"}
\ No newline at end of file
diff --git a/testapp/hybrid/app/ng1.ts b/testapp/hybrid/app/ng1.ts
deleted file mode 100644
index a334e80a4..000000000
--- a/testapp/hybrid/app/ng1.ts
+++ /dev/null
@@ -1,18 +0,0 @@
-function ctrl($scope: any, $timeout: any) {
- $scope.callCount = 0;
-
- $scope.clickButton = function() {
- $timeout(() => {
- $scope.callCount++;
- }, 1000);
- };
-}
-
-export function ng1Dir() {
- return {
- scope: {},
- templateUrl: './html/ng1.html',
- controller: ctrl,
- controllerAs: 'ctrl'
- };
-}
diff --git a/testapp/hybrid/app/ng2.js.map b/testapp/hybrid/app/ng2.js.map
deleted file mode 100644
index db9bb6c25..000000000
--- a/testapp/hybrid/app/ng2.js.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"ng2.js","sourceRoot":"","sources":["ng2.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,qBAAwB,eAAe,CAAC,CAAA;AAOxC;IAAA;QAAA,iBAOC;QANC,cAAS,GAAW,CAAC,CAAC;QACtB,gBAAW,GAAG;YACZ,UAAU,CAAC;gBACT,KAAI,CAAC,SAAS,EAAE,CAAC;YACnB,CAAC,EAAE,IAAI,CAAC,CAAC;QACX,CAAC,CAAC;IACJ,CAAC;IAXD;QAAC,gBAAS,CAAC;YACT,QAAQ,EAAE,KAAK;YACf,WAAW,EAAE,iBAAiB;SAC/B,CAAC;;oBAAA;IAQF,mBAAC;AAAD,CAAC,AAPD,IAOC;AAPY,oBAAY,eAOxB,CAAA"}
\ No newline at end of file
diff --git a/testapp/hybrid/app/upgrader.js.map b/testapp/hybrid/app/upgrader.js.map
deleted file mode 100644
index ecd545be7..000000000
--- a/testapp/hybrid/app/upgrader.js.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"upgrader.js","sourceRoot":"","sources":["upgrader.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,wBAA+B,kBAAkB,CAAC,CAAA;AAClD,iCAA8B,2BAA2B,CAAC,CAAA;AAC1D,qBAAqC,eAAe,CAAC,CAAA;AACrD,oBAA6B,OAG7B,CAAC,CAHmC;AAGvB,eAAO,GAAmB,IAAI,wBAAc,CAAC,iBAAU,CAAC,cAAM,OAAA,SAAS,EAAT,CAAS,CAAC,CAAC,CAAC;AAWvF;IAAA;IAAwB,CAAC;IATzB;QAAC,eAAQ,CAAC;YACR,OAAO,EAAE;gBACP,gCAAa;aACd;YACD,YAAY,EAAE;gBACZ,kBAAY,EAAE,eAAO,CAAC,mBAAmB,CAAC,KAAK,CAAC;aACjD;SAEF,CAAC;;iBAAA;IACsB,gBAAC;AAAD,CAAC,AAAzB,IAAyB;AAAZ,iBAAS,YAAG,CAAA"}
\ No newline at end of file
diff --git a/testapp/index.html b/testapp/index.html
index a92cf8d6f..1446a72b2 100644
--- a/testapp/index.html
+++ b/testapp/index.html
@@ -11,8 +11,11 @@
Choose Version
Angular 1
-
- Hybrid
+
+ Hybrid (JIT)
+
+
+ Hybrid (AOT)
Angular 2
diff --git a/testapp/package.json b/testapp/package.json
index 339a58760..1e47d8c01 100644
--- a/testapp/package.json
+++ b/testapp/package.json
@@ -5,30 +5,30 @@
"start": "concurrently \"npm run tsc:w\" \"npm run lite\" ",
"tsc": "tsc",
"tsc:w": "tsc -w",
- "lite": "lite-server",
- "typings": "typings",
- "postinstall": "typings install"
+ "lite": "lite-server"
},
"dependencies": {
- "@angular/common": "2.2.0",
- "@angular/compiler": "2.2.0",
- "@angular/core": "2.2.0",
- "@angular/http": "2.2.0",
- "@angular/platform-browser": "2.2.0",
- "@angular/platform-browser-dynamic": "2.2.0",
+ "@angular/common": "2.2.1",
+ "@angular/compiler": "2.2.1",
+ "@angular/core": "2.2.1",
+ "@angular/http": "2.2.1",
+ "@angular/platform-browser": "2.2.1",
+ "@angular/platform-browser-dynamic": "2.2.1",
"@angular/router": "3.0.0",
- "@angular/upgrade": "2.2.0",
- "systemjs": "0.19.27",
+ "@angular/upgrade": "2.2.1",
+ "@types/angular": "^1.5.20",
+ "@types/core-js": "^0.9.34",
+ "@types/node": "^6.0.48",
"core-js": "2.4.1",
"reflect-metadata": "0.1.3",
"rxjs": "5.0.0-beta.12",
+ "systemjs": "0.19.27",
"zone.js": "0.6.25"
},
"devDependencies": {
"concurrently": "2.2.0",
+ "express": "4.13.3",
"lite-server": "2.2.0",
- "typescript": "1.8.10",
- "typings":"1.0.4",
- "express": "4.13.3"
+ "typescript": "^2.0.10"
}
}
diff --git a/testapp/tsconfig.json b/testapp/tsconfig.json
index 123f2c46e..e6732d726 100644
--- a/testapp/tsconfig.json
+++ b/testapp/tsconfig.json
@@ -8,10 +8,14 @@
"experimentalDecorators": true,
"removeComments": false,
"noImplicitAny": false,
- "suppressImplicitAnyIndexErrors": true
+ "suppressImplicitAnyIndexErrors": true,
+ "typeRoots": [
+ "./node_modules/@types/"
+ ]
},
+ "compileOnSave": true,
"exclude": [
- "typings/globals",
- "node_modules"
+ "node_modules",
+ "**/*-aot.ts"
]
}
diff --git a/testapp/typings.json b/testapp/typings.json
deleted file mode 100644
index c19da1ebb..000000000
--- a/testapp/typings.json
+++ /dev/null
@@ -1,6 +0,0 @@
-{
- "globalDependencies": {
- "core-js": "registry:dt/core-js#0.0.0+20160725163759",
- "node": "registry:dt/node#6.0.0+20160831021119"
- }
-}
diff --git a/testapp/upgrade/app/main.js b/testapp/upgrade/app/main.js
new file mode 100644
index 000000000..ea2adad73
--- /dev/null
+++ b/testapp/upgrade/app/main.js
@@ -0,0 +1,9 @@
+"use strict";
+var platform_browser_dynamic_1 = require('@angular/platform-browser-dynamic');
+var static_1 = require('@angular/upgrade/static');
+var module_1 = require('./module');
+platform_browser_dynamic_1.platformBrowserDynamic().bootstrapModule(module_1.AppModule).then(function (platformRef) {
+ var upgrade = platformRef.injector.get(static_1.UpgradeModule);
+ upgrade.bootstrap(document.body, ['upgradeApp'], { strictDi: true });
+});
+//# sourceMappingURL=main.js.map
\ No newline at end of file
diff --git a/testapp/upgrade/app/main.ts b/testapp/upgrade/app/main.ts
new file mode 100644
index 000000000..c6060407f
--- /dev/null
+++ b/testapp/upgrade/app/main.ts
@@ -0,0 +1,9 @@
+import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
+import { UpgradeModule } from '@angular/upgrade/static';
+
+import { AppModule } from './module';
+
+platformBrowserDynamic().bootstrapModule(AppModule).then(platformRef => {
+ const upgrade = platformRef.injector.get(UpgradeModule) as UpgradeModule;
+ upgrade.bootstrap(document.body, ['upgradeApp'], {strictDi: true});
+});
diff --git a/testapp/upgrade/app/module.js b/testapp/upgrade/app/module.js
new file mode 100644
index 000000000..97d67fb5a
--- /dev/null
+++ b/testapp/upgrade/app/module.js
@@ -0,0 +1,46 @@
+"use strict";
+var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
+};
+var __metadata = (this && this.__metadata) || function (k, v) {
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
+};
+var core_1 = require('@angular/core');
+var platform_browser_1 = require('@angular/platform-browser');
+var static_1 = require('@angular/upgrade/static');
+var myApp_1 = require('./myApp');
+var ng2_1 = require('./ng2');
+var ng1_1 = require('./ng1');
+var AppModule = (function () {
+ function AppModule() {
+ }
+ AppModule.prototype.ngDoBootstrap = function () { };
+ AppModule = __decorate([
+ core_1.NgModule({
+ imports: [
+ platform_browser_1.BrowserModule,
+ static_1.UpgradeModule
+ ],
+ declarations: [
+ ng2_1.Ng2Component,
+ ng1_1.Ng1Component,
+ ],
+ entryComponents: [
+ ng2_1.Ng2Component
+ ]
+ }),
+ __metadata('design:paramtypes', [])
+ ], AppModule);
+ return AppModule;
+}());
+exports.AppModule = AppModule;
+angular.module('upgradeApp', [])
+ .directive('ng1', ng1_1.Ng1Directive)
+ .directive('ng2', static_1.downgradeComponent({
+ component: ng2_1.Ng2Component,
+}))
+ .directive('myApp', myApp_1.RootDirective);
+//# sourceMappingURL=module.js.map
\ No newline at end of file
diff --git a/testapp/upgrade/app/module.ts b/testapp/upgrade/app/module.ts
new file mode 100644
index 000000000..d963324b7
--- /dev/null
+++ b/testapp/upgrade/app/module.ts
@@ -0,0 +1,32 @@
+declare var angular: angular.IAngularStatic;
+import { NgModule } from '@angular/core';
+import { BrowserModule } from '@angular/platform-browser';
+import { UpgradeModule, downgradeComponent } from '@angular/upgrade/static';
+
+import { RootDirective } from './myApp';
+import { Ng2Component } from './ng2';
+import { Ng1Directive, Ng1Component } from './ng1';
+
+@NgModule({
+ imports: [
+ BrowserModule,
+ UpgradeModule
+ ],
+ declarations: [
+ Ng2Component,
+ Ng1Component,
+ ],
+ entryComponents: [
+ Ng2Component
+ ]
+})
+export class AppModule {
+ ngDoBootstrap() {}
+}
+
+angular.module('upgradeApp', [])
+ .directive('ng1', Ng1Directive)
+ .directive('ng2', downgradeComponent({
+ component: Ng2Component,
+ }) as angular.IDirectiveFactory)
+ .directive('myApp', RootDirective);
diff --git a/testapp/hybrid/app/myApp.js b/testapp/upgrade/app/myApp.js
similarity index 71%
rename from testapp/hybrid/app/myApp.js
rename to testapp/upgrade/app/myApp.js
index a6ad40296..7e2bb7088 100644
--- a/testapp/hybrid/app/myApp.js
+++ b/testapp/upgrade/app/myApp.js
@@ -7,13 +7,13 @@ function ctrl($scope, $timeout) {
}, 1000);
};
}
-function myApp() {
+ctrl.$inject = ['$scope', '$timeout'];
+function RootDirective() {
return {
scope: {},
templateUrl: './html/myApp.html',
- controller: ctrl,
- controllerAs: 'ctrl'
+ controller: ctrl
};
}
-exports.myApp = myApp;
+exports.RootDirective = RootDirective;
//# sourceMappingURL=myApp.js.map
\ No newline at end of file
diff --git a/testapp/hybrid/app/myApp.ts b/testapp/upgrade/app/myApp.ts
similarity index 72%
rename from testapp/hybrid/app/myApp.ts
rename to testapp/upgrade/app/myApp.ts
index 9c9c13d2d..8f10a071c 100644
--- a/testapp/hybrid/app/myApp.ts
+++ b/testapp/upgrade/app/myApp.ts
@@ -7,12 +7,12 @@ function ctrl($scope: any, $timeout: any) {
}, 1000);
};
}
+ctrl.$inject = ['$scope', '$timeout'];
-export function myApp() {
+export function RootDirective() {
return {
scope: {},
templateUrl: './html/myApp.html',
- controller: ctrl,
- controllerAs: 'ctrl'
+ controller: ctrl
};
}
diff --git a/testapp/upgrade/app/ng1.js b/testapp/upgrade/app/ng1.js
new file mode 100644
index 000000000..5fe42a1f7
--- /dev/null
+++ b/testapp/upgrade/app/ng1.js
@@ -0,0 +1,49 @@
+"use strict";
+var __extends = (this && this.__extends) || function (d, b) {
+ for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
+ function __() { this.constructor = d; }
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
+};
+var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
+};
+var __metadata = (this && this.__metadata) || function (k, v) {
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
+};
+function ctrl($scope, $timeout) {
+ $scope.callCount = 0;
+ $scope.clickButton = function () {
+ $timeout(function () {
+ $scope.callCount++;
+ }, 1000);
+ };
+}
+ctrl.$inject = ['$scope', '$timeout'];
+function Ng1Directive() {
+ return {
+ scope: {},
+ template: 'ng1
',
+ controller: ctrl
+ };
+}
+exports.Ng1Directive = Ng1Directive;
+var core_1 = require('@angular/core');
+var static_1 = require('@angular/upgrade/static');
+var Ng1Component = (function (_super) {
+ __extends(Ng1Component, _super);
+ function Ng1Component(elementRef, injector) {
+ _super.call(this, 'ng1', elementRef, injector);
+ }
+ Ng1Component = __decorate([
+ core_1.Directive({
+ selector: 'ng1'
+ }),
+ __metadata('design:paramtypes', [core_1.ElementRef, core_1.Injector])
+ ], Ng1Component);
+ return Ng1Component;
+}(static_1.UpgradeComponent));
+exports.Ng1Component = Ng1Component;
+//# sourceMappingURL=ng1.js.map
\ No newline at end of file
diff --git a/testapp/upgrade/app/ng1.ts b/testapp/upgrade/app/ng1.ts
new file mode 100644
index 000000000..e910be443
--- /dev/null
+++ b/testapp/upgrade/app/ng1.ts
@@ -0,0 +1,30 @@
+function ctrl($scope: any, $timeout: any) {
+ $scope.callCount = 0;
+
+ $scope.clickButton = function() {
+ $timeout(() => {
+ $scope.callCount++;
+ }, 1000);
+ };
+}
+ctrl.$inject = ['$scope', '$timeout'];
+
+export function Ng1Directive() {
+ return {
+ scope: {},
+ template: 'ng1
',
+ controller: ctrl
+ };
+}
+
+import { Directive, ElementRef, Injector } from '@angular/core';
+import { UpgradeComponent } from '@angular/upgrade/static';
+@Directive({
+ selector: 'ng1'
+})
+export class Ng1Component extends UpgradeComponent {
+ constructor(elementRef: ElementRef, injector: Injector) {
+ super('ng1', elementRef, injector);
+ }
+}
+
diff --git a/testapp/hybrid/app/ng2.js b/testapp/upgrade/app/ng2.js
similarity index 100%
rename from testapp/hybrid/app/ng2.js
rename to testapp/upgrade/app/ng2.js
diff --git a/testapp/hybrid/app/ng2.ts b/testapp/upgrade/app/ng2.ts
similarity index 87%
rename from testapp/hybrid/app/ng2.ts
rename to testapp/upgrade/app/ng2.ts
index 3f41ba85b..87b168668 100644
--- a/testapp/hybrid/app/ng2.ts
+++ b/testapp/upgrade/app/ng2.ts
@@ -1,5 +1,4 @@
import {Component} from '@angular/core';
-import {adapter} from './upgrader';
@Component({
selector: 'ng2',
diff --git a/testapp/upgrade/app/no_static/main.js b/testapp/upgrade/app/no_static/main.js
new file mode 100644
index 000000000..73b8a8e36
--- /dev/null
+++ b/testapp/upgrade/app/no_static/main.js
@@ -0,0 +1,11 @@
+"use strict";
+var myApp_1 = require('../myApp');
+var ng2_1 = require('../ng2');
+var ng1_1 = require('../ng1');
+var upgrader_1 = require('./upgrader');
+var ng1module = angular.module('upgradeApp', []);
+ng1module.directive('myApp', myApp_1.RootDirective);
+ng1module.directive('ng2', upgrader_1.adapter.downgradeNg2Component(ng2_1.Ng2Component));
+ng1module.directive('ng1', ng1_1.Ng1Directive);
+upgrader_1.adapter.bootstrap(document.body, ['upgradeApp']);
+//# sourceMappingURL=main.js.map
\ No newline at end of file
diff --git a/testapp/upgrade/app/no_static/main.ts b/testapp/upgrade/app/no_static/main.ts
new file mode 100644
index 000000000..6bfc05e99
--- /dev/null
+++ b/testapp/upgrade/app/no_static/main.ts
@@ -0,0 +1,14 @@
+import {RootDirective} from '../myApp'
+import {Ng2Component} from '../ng2'
+import {Ng1Directive} from '../ng1'
+import {adapter} from './upgrader';
+
+declare var angular;
+
+var ng1module = angular.module('upgradeApp', []);
+
+ng1module.directive('myApp', RootDirective);
+ng1module.directive('ng2', adapter.downgradeNg2Component(Ng2Component));
+ng1module.directive('ng1', Ng1Directive);
+
+adapter.bootstrap(document.body, ['upgradeApp']);
diff --git a/testapp/hybrid/app/upgrader.js b/testapp/upgrade/app/no_static/upgrader.js
similarity index 97%
rename from testapp/hybrid/app/upgrader.js
rename to testapp/upgrade/app/no_static/upgrader.js
index 61384691a..bc00c5874 100644
--- a/testapp/hybrid/app/upgrader.js
+++ b/testapp/upgrade/app/no_static/upgrader.js
@@ -11,7 +11,7 @@ var __metadata = (this && this.__metadata) || function (k, v) {
var upgrade_1 = require('@angular/upgrade');
var platform_browser_1 = require('@angular/platform-browser');
var core_1 = require('@angular/core');
-var ng2_1 = require('./ng2');
+var ng2_1 = require('../ng2');
exports.adapter = new upgrade_1.UpgradeAdapter(core_1.forwardRef(function () { return Ng2Module; }));
var Ng2Module = (function () {
function Ng2Module() {
diff --git a/testapp/hybrid/app/upgrader.ts b/testapp/upgrade/app/no_static/upgrader.ts
similarity index 91%
rename from testapp/hybrid/app/upgrader.ts
rename to testapp/upgrade/app/no_static/upgrader.ts
index 5c189c1cd..066ed66c7 100644
--- a/testapp/hybrid/app/upgrader.ts
+++ b/testapp/upgrade/app/no_static/upgrader.ts
@@ -1,7 +1,7 @@
import { UpgradeAdapter } from '@angular/upgrade';
import { BrowserModule } from '@angular/platform-browser';
import { forwardRef, NgModule } from '@angular/core';
-import { Ng2Component } from './ng2'
+import { Ng2Component } from '../ng2'
export const adapter: UpgradeAdapter = new UpgradeAdapter(forwardRef(() => Ng2Module));
diff --git a/testapp/hybrid/html/myApp.html b/testapp/upgrade/html/myApp.html
similarity index 100%
rename from testapp/hybrid/html/myApp.html
rename to testapp/upgrade/html/myApp.html
diff --git a/testapp/hybrid/html/ng1.html b/testapp/upgrade/html/ng1.html
similarity index 100%
rename from testapp/hybrid/html/ng1.html
rename to testapp/upgrade/html/ng1.html
diff --git a/testapp/hybrid/html/ng2.html b/testapp/upgrade/html/ng2.html
similarity index 100%
rename from testapp/hybrid/html/ng2.html
rename to testapp/upgrade/html/ng2.html
diff --git a/testapp/hybrid/index.html b/testapp/upgrade/index.html
similarity index 87%
rename from testapp/hybrid/index.html
rename to testapp/upgrade/index.html
index 68f6de418..2b5772b22 100644
--- a/testapp/hybrid/index.html
+++ b/testapp/upgrade/index.html
@@ -2,7 +2,7 @@
-
+
Test ngUpgrade App
@@ -20,7 +20,11 @@