diff --git a/public/docs/_examples/.gitignore b/public/docs/_examples/.gitignore
index d3e14b4f54..eedd04da43 100644
--- a/public/docs/_examples/.gitignore
+++ b/public/docs/_examples/.gitignore
@@ -15,4 +15,3 @@ protractor-helpers.js
**/ts/**/*.js
**/js-es6*/**/*.js
**/ts-snippets/**/*.js
-!**/systemjs.config.extras.js
diff --git a/public/docs/_examples/_boilerplate/src/systemjs.config.js b/public/docs/_examples/_boilerplate/src/systemjs.config.js
index 0d748b9e5e..5fa7e9c24f 100644
--- a/public/docs/_examples/_boilerplate/src/systemjs.config.js
+++ b/public/docs/_examples/_boilerplate/src/systemjs.config.js
@@ -23,8 +23,6 @@
'@angular/router': 'npm:@angular/router/bundles/router.umd.js',
'@angular/router/upgrade': 'npm:@angular/router/bundles/router-upgrade.umd.js',
'@angular/forms': 'npm:@angular/forms/bundles/forms.umd.js',
- '@angular/upgrade': 'npm:@angular/upgrade/bundles/upgrade.umd.js',
- '@angular/upgrade/static': 'npm:@angular/upgrade/bundles/upgrade-static.umd.js',
// other libraries
'rxjs': 'npm:rxjs',
diff --git a/public/docs/_examples/upgrade-module/e2e-spec.ts b/public/docs/_examples/upgrade-module/e2e-spec.ts
index dbf29e3f53..0c45fb78b8 100644
--- a/public/docs/_examples/upgrade-module/e2e-spec.ts
+++ b/public/docs/_examples/upgrade-module/e2e-spec.ts
@@ -98,7 +98,7 @@ describe('Upgrade Tests', function () {
expect(element.all(by.css('h2')).first().getText()).toEqual('Windstorm details!');
});
- xit('has outputs', function () {
+ it('has outputs', function () {
element.all(by.buttonText('Delete')).first().click();
expect(element.all(by.css('h2')).first().getText()).toEqual('Ex-Windstorm details!');
});
@@ -161,4 +161,22 @@ describe('Upgrade Tests', function () {
});
+ describe('Dividing routes', function() {
+
+ beforeAll(function () {
+ browser.get('/index-divide-routes.html');
+ });
+
+ it('allows ng1 routes', function () {
+ browser.get('/index-divide-routes.html#/villain');
+ expect(element(by.css('h2')).getText()).toBe('Mr. Nice - No More Mr. Nice Guy');
+ });
+
+ it('allows ng2 routes', function () {
+ browser.get('/index-divide-routes.html#/hero');
+ expect(element(by.css('h2')).getText()).toBe('Windstorm - Specific powers of controlling winds');
+ });
+
+ });
+
});
diff --git a/public/docs/_examples/upgrade-module/ts/.gitignore b/public/docs/_examples/upgrade-module/ts/.gitignore
new file mode 100644
index 0000000000..7f5c313a3e
--- /dev/null
+++ b/public/docs/_examples/upgrade-module/ts/.gitignore
@@ -0,0 +1,7 @@
+**/*.js
+aot/**/*
+!aot/bs-config.json
+!aot/index.html
+!copy-dist-files.js
+!rollup-config.js
+!systemjs.config.1.js
diff --git a/public/docs/_examples/upgrade-module/ts/src/app/ajs-to-a-providers/ajs-upgraded-providers.ts b/public/docs/_examples/upgrade-module/ts/src/app/ajs-to-a-providers/ajs-upgraded-providers.ts
new file mode 100644
index 0000000000..52d4e74a1f
--- /dev/null
+++ b/public/docs/_examples/upgrade-module/ts/src/app/ajs-to-a-providers/ajs-upgraded-providers.ts
@@ -0,0 +1,12 @@
+// #docregion
+import { HeroesService } from './heroes.service';
+
+export function heroesServiceFactory(i: any) {
+ return i.get('heroes');
+}
+
+export const heroesServiceProvider = {
+ provide: HeroesService,
+ useFactory: heroesServiceFactory,
+ deps: ['$injector']
+};
diff --git a/public/docs/_examples/upgrade-module/ts/src/app/ajs-to-a-providers/app.module.ts b/public/docs/_examples/upgrade-module/ts/src/app/ajs-to-a-providers/app.module.ts
index 5754494853..4e0eca003a 100644
--- a/public/docs/_examples/upgrade-module/ts/src/app/ajs-to-a-providers/app.module.ts
+++ b/public/docs/_examples/upgrade-module/ts/src/app/ajs-to-a-providers/app.module.ts
@@ -6,18 +6,17 @@ import { UpgradeModule, downgradeComponent } from '@angular/upgrade/static';
import { HeroDetailComponent } from './hero-detail.component';
import { HeroesService } from './heroes.service';
-
// #docregion register
+import { heroesServiceProvider } from './ajs-upgraded-providers';
+
@NgModule({
imports: [
BrowserModule,
UpgradeModule
],
- providers: [{
- provide: 'heroes',
- useFactory: (i: any) => i.get('heroes'),
- deps: ['$injector']
- }],
+ providers: [
+ heroesServiceProvider
+ ],
// #enddocregion register
declarations: [
HeroDetailComponent
@@ -39,7 +38,6 @@ angular.module('heroApp', [])
downgradeComponent({component: HeroDetailComponent}) as angular.IDirectiveFactory
);
-
platformBrowserDynamic().bootstrapModule(AppModule).then(platformRef => {
const upgrade = platformRef.injector.get(UpgradeModule) as UpgradeModule;
upgrade.bootstrap(document.body, ['heroApp'], {strictDi: true});
diff --git a/public/docs/_examples/upgrade-module/ts/src/app/ajs-to-a-providers/hero-detail.component.ts b/public/docs/_examples/upgrade-module/ts/src/app/ajs-to-a-providers/hero-detail.component.ts
index 3ad50cd961..b02f85b99a 100644
--- a/public/docs/_examples/upgrade-module/ts/src/app/ajs-to-a-providers/hero-detail.component.ts
+++ b/public/docs/_examples/upgrade-module/ts/src/app/ajs-to-a-providers/hero-detail.component.ts
@@ -1,5 +1,5 @@
// #docregion
-import { Component, Inject } from '@angular/core';
+import { Component } from '@angular/core';
import { HeroesService } from './heroes.service';
import { Hero } from '../hero';
@@ -11,7 +11,7 @@ import { Hero } from '../hero';
})
export class HeroDetailComponent {
hero: Hero;
- constructor(@Inject('heroes') heroes: HeroesService) {
+ constructor(heroes: HeroesService) {
this.hero = heroes.get()[0];
}
}
diff --git a/public/docs/_examples/upgrade-module/ts/src/app/divide-routes/app.component.ts b/public/docs/_examples/upgrade-module/ts/src/app/divide-routes/app.component.ts
new file mode 100644
index 0000000000..1fae3f84c6
--- /dev/null
+++ b/public/docs/_examples/upgrade-module/ts/src/app/divide-routes/app.component.ts
@@ -0,0 +1,11 @@
+// #docregion
+import { Component } from '@angular/core';
+
+@Component({
+ selector: 'my-app',
+ template: `
+