diff --git a/modules/@angular/upgrade/rollup.config.js b/modules/@angular/upgrade/rollup.config.js index 014fbbb4fc..0b23f0fd5b 100644 --- a/modules/@angular/upgrade/rollup.config.js +++ b/modules/@angular/upgrade/rollup.config.js @@ -9,13 +9,11 @@ export default { '@angular/common': 'ng.common', '@angular/compiler': 'ng.compiler', '@angular/platform-browser': 'ng.platformBrowser', - '@angular/platform-browser-dynamic': 'ng.platformBrowser.dynamic', + '@angular/platform-browser-dynamic': 'ng.platformBrowserDynamic', 'rxjs/Subject': 'Rx', 'rxjs/observable/PromiseObservable': 'Rx', // this is wrong, but this stuff has changed in rxjs b.6 so we need to fix it when we update. 'rxjs/operator/toPromise': 'Rx.Observable.prototype', 'rxjs/Observable': 'Rx' }, - plugins: [ -// nodeResolve({ jsnext: true, main: true }), - ] + plugins: [] } diff --git a/modules/playground/e2e_test/upgrade/upgrade_spec.ts b/modules/playground/e2e_test/upgrade/upgrade_spec.ts new file mode 100644 index 0000000000..98de255562 --- /dev/null +++ b/modules/playground/e2e_test/upgrade/upgrade_spec.ts @@ -0,0 +1,19 @@ +import {verifyNoBrowserErrors} from "@angular/platform-browser/testing_e2e"; + +// TODO(i): reenable once we fix issue with exposing testability to protractor when using ngUpgrade +// https://github.com/angular/angular/issues/9407 +xdescribe('ngUpgrade', function() { + var URL = 'all/playground/src/upgrade/index.html'; + + beforeEach(function() { browser.get(URL); }); + + afterEach(verifyNoBrowserErrors); + + it('should bootstrap Angular 1 and Angular 2 apps together', function() { + var ng1NameInput = element(by.css('input[ng-model]=name')); + expect(ng1NameInput.getAttribute('value')).toEqual('World'); + + var userSpan = element(by.css('user span')); + expect(userSpan.getText()).toMatch('/World$/'); + }); +}); diff --git a/modules/playground/src/upgrade/index.html b/modules/playground/src/upgrade/index.html index 9b3d0f8cf7..499a7be8fa 100644 --- a/modules/playground/src/upgrade/index.html +++ b/modules/playground/src/upgrade/index.html @@ -12,7 +12,7 @@ - Your name: + Your name:
Greetings from {{name}}!
diff --git a/modules/playground/src/upgrade/index.ts b/modules/playground/src/upgrade/index.ts index 69ab973225..a806d09637 100644 --- a/modules/playground/src/upgrade/index.ts +++ b/modules/playground/src/upgrade/index.ts @@ -1,6 +1,8 @@ import {Component, Input, Output, EventEmitter} from '@angular/core'; import {UpgradeAdapter} from '@angular/upgrade'; -import * as angular from '@angular/upgrade/src/angular_js'; + +declare var angular: any; + var styles = [ `