From a35fcb4dfdaff75ce81cd8e9f555d3d476f7b57c Mon Sep 17 00:00:00 2001 From: Brandon Roberts Date: Sun, 14 Aug 2016 13:54:33 -0500 Subject: [PATCH] chore(router): Added ModuleWithProviders to routing exports closes #2113 --- .../cb-a1-a2-quick-reference/ts/app/app.module.ts | 5 ++--- .../cb-a1-a2-quick-reference/ts/app/app.routes.ts | 9 --------- .../cb-a1-a2-quick-reference/ts/app/app.routing.ts | 12 ++++++++++++ .../cb-dependency-injection/ts/app/app.module.ts | 12 ++++++++---- .../cb-dependency-injection/ts/app/app.routes.ts | 7 ------- .../cb-dependency-injection/ts/app/app.routing.ts | 10 ++++++++++ .../docs/_examples/ngmodule/ts/app/app.routing.3.ts | 3 ++- public/docs/_examples/ngmodule/ts/app/app.routing.ts | 3 ++- .../ngmodule/ts/app/contact/contact.routing.3.ts | 3 ++- .../ngmodule/ts/app/contact/contact.routing.ts | 3 ++- .../ngmodule/ts/app/crisis/crisis.routing.ts | 3 ++- .../_examples/ngmodule/ts/app/hero/hero.routing.3.ts | 3 ++- .../_examples/ngmodule/ts/app/hero/hero.routing.ts | 3 ++- public/docs/_examples/router/ts/app/app.routing.1.ts | 3 ++- public/docs/_examples/router/ts/app/app.routing.2.ts | 3 ++- public/docs/_examples/router/ts/app/app.routing.3.ts | 3 ++- public/docs/_examples/router/ts/app/app.routing.4.ts | 3 ++- public/docs/_examples/router/ts/app/app.routing.5.ts | 3 ++- public/docs/_examples/router/ts/app/app.routing.6.ts | 3 ++- public/docs/_examples/router/ts/app/app.routing.ts | 3 ++- .../ts/app/crisis-center/crisis-center.routing.1.ts | 3 ++- .../ts/app/crisis-center/crisis-center.routing.2.ts | 3 ++- .../ts/app/crisis-center/crisis-center.routing.3.ts | 3 ++- .../ts/app/crisis-center/crisis-center.routing.4.ts | 3 ++- .../ts/app/crisis-center/crisis-center.routing.5.ts | 3 ++- .../ts/app/crisis-center/crisis-center.routing.ts | 3 ++- .../_examples/router/ts/app/heroes/heroes.routing.ts | 3 ++- .../docs/_examples/style-guide/ts/app/app.routes.ts | 5 ++--- public/docs/_examples/toh-5/ts/app/app.routing.1.ts | 9 ++++++--- public/docs/_examples/toh-5/ts/app/app.routing.ts | 4 ++-- public/docs/_examples/toh-6/ts/app/app.routing.ts | 3 ++- public/docs/ts/latest/guide/router.jade | 4 ++-- public/docs/ts/latest/tutorial/toh-pt5.jade | 2 +- 33 files changed, 89 insertions(+), 56 deletions(-) delete mode 100644 public/docs/_examples/cb-a1-a2-quick-reference/ts/app/app.routes.ts create mode 100644 public/docs/_examples/cb-a1-a2-quick-reference/ts/app/app.routing.ts delete mode 100644 public/docs/_examples/cb-dependency-injection/ts/app/app.routes.ts create mode 100644 public/docs/_examples/cb-dependency-injection/ts/app/app.routing.ts diff --git a/public/docs/_examples/cb-a1-a2-quick-reference/ts/app/app.module.ts b/public/docs/_examples/cb-a1-a2-quick-reference/ts/app/app.module.ts index 08391524b9..dec4a4e223 100644 --- a/public/docs/_examples/cb-a1-a2-quick-reference/ts/app/app.module.ts +++ b/public/docs/_examples/cb-a1-a2-quick-reference/ts/app/app.module.ts @@ -2,17 +2,16 @@ import { NgModule } from '@angular/core'; import { BrowserModule } from '@angular/platform-browser'; import { FormsModule } from '@angular/forms'; -import { RouterModule } from '@angular/router'; import { AppComponent } from './app.component'; import { MovieListComponent } from './movie-list.component'; -import { routes } from './app.routes'; +import { routing } from './app.routing'; @NgModule({ imports: [ BrowserModule, FormsModule, - RouterModule.forRoot(routes, {}) + routing ], declarations: [ AppComponent, diff --git a/public/docs/_examples/cb-a1-a2-quick-reference/ts/app/app.routes.ts b/public/docs/_examples/cb-a1-a2-quick-reference/ts/app/app.routes.ts deleted file mode 100644 index 67aa75ed25..0000000000 --- a/public/docs/_examples/cb-a1-a2-quick-reference/ts/app/app.routes.ts +++ /dev/null @@ -1,9 +0,0 @@ -// #docregion -import { RouterConfig } from '@angular/router'; - -import { MovieListComponent } from './movie-list.component'; - -export const routes: RouterConfig = [ - { path: '', redirectTo: '/movies', pathMatch: 'full' }, - { path: 'movies', component: MovieListComponent } -]; diff --git a/public/docs/_examples/cb-a1-a2-quick-reference/ts/app/app.routing.ts b/public/docs/_examples/cb-a1-a2-quick-reference/ts/app/app.routing.ts new file mode 100644 index 0000000000..fb042725eb --- /dev/null +++ b/public/docs/_examples/cb-a1-a2-quick-reference/ts/app/app.routing.ts @@ -0,0 +1,12 @@ +// #docregion +import { ModuleWithProviders } from '@angular/core'; +import { Routes, RouterModule } from '@angular/router'; + +import { MovieListComponent } from './movie-list.component'; + +const routes: Routes = [ + { path: '', redirectTo: '/movies', pathMatch: 'full' }, + { path: 'movies', component: MovieListComponent } +]; + +export const routing: ModuleWithProviders = RouterModule.forRoot(routes); diff --git a/public/docs/_examples/cb-dependency-injection/ts/app/app.module.ts b/public/docs/_examples/cb-dependency-injection/ts/app/app.module.ts index 326ea4e945..1f160dd0ce 100644 --- a/public/docs/_examples/cb-dependency-injection/ts/app/app.module.ts +++ b/public/docs/_examples/cb-dependency-injection/ts/app/app.module.ts @@ -2,7 +2,8 @@ import { BrowserModule } from '@angular/platform-browser'; import { FormsModule } from '@angular/forms'; import { XHRBackend } from '@angular/http'; -// import { appRouterProviders } from './app.routes'; +/* import { routing, + appRoutingProviders } from './app.routing';*/ import { LocationStrategy, HashLocationStrategy } from '@angular/common'; import { NgModule } from '@angular/core'; @@ -51,7 +52,11 @@ const C_DIRECTIVES = [ // #docregion bootstrap @NgModule({ - imports: [ BrowserModule, FormsModule ], + imports: [ + BrowserModule, + FormsModule, + // routing TODO: add routes + ], declarations: [ ...DIRECTIVES, ...B_DIRECTIVES, ...C_DIRECTIVES, @@ -59,7 +64,7 @@ const C_DIRECTIVES = [ AlexComponent ], bootstrap: [ AppComponent ], providers: [ - // appRouterProviders, TODO: add routes + // appRoutingProviders, TODO: add routes { provide: LocationStrategy, useClass: HashLocationStrategy }, { provide: XHRBackend, useClass: InMemoryBackendService }, // in-mem server @@ -71,4 +76,3 @@ export class AppModule { } } // #enddocregion bootstraps - diff --git a/public/docs/_examples/cb-dependency-injection/ts/app/app.routes.ts b/public/docs/_examples/cb-dependency-injection/ts/app/app.routes.ts deleted file mode 100644 index c8eb6ee683..0000000000 --- a/public/docs/_examples/cb-dependency-injection/ts/app/app.routes.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { provideRouter, RouterConfig } from '@angular/router'; - -const routes: RouterConfig = []; - -export const appRouterProviders = [ - provideRouter(routes) -]; diff --git a/public/docs/_examples/cb-dependency-injection/ts/app/app.routing.ts b/public/docs/_examples/cb-dependency-injection/ts/app/app.routing.ts new file mode 100644 index 0000000000..2d3556371d --- /dev/null +++ b/public/docs/_examples/cb-dependency-injection/ts/app/app.routing.ts @@ -0,0 +1,10 @@ +import { ModuleWithProviders } from '@angular/core'; +import { Routes, RouterModule } from '@angular/router'; + +const routes: Routes = []; + +export const routing: ModuleWithProviders = RouterModule.forRoot(routes); + +export const appRoutingProviders: any[] = [ + +]; diff --git a/public/docs/_examples/ngmodule/ts/app/app.routing.3.ts b/public/docs/_examples/ngmodule/ts/app/app.routing.3.ts index 96eebf5dac..994807b5bd 100644 --- a/public/docs/_examples/ngmodule/ts/app/app.routing.3.ts +++ b/public/docs/_examples/ngmodule/ts/app/app.routing.3.ts @@ -1,3 +1,4 @@ +import { ModuleWithProviders } from '@angular/core'; import { Routes, RouterModule } from '@angular/router'; @@ -7,4 +8,4 @@ export const routes: Routes = [ { path: 'heroes', loadChildren: 'app/hero/hero.module.3' } ]; -export const routing = RouterModule.forRoot(routes); +export const routing: ModuleWithProviders = RouterModule.forRoot(routes); diff --git a/public/docs/_examples/ngmodule/ts/app/app.routing.ts b/public/docs/_examples/ngmodule/ts/app/app.routing.ts index 09fa0225d8..6e654ca649 100644 --- a/public/docs/_examples/ngmodule/ts/app/app.routing.ts +++ b/public/docs/_examples/ngmodule/ts/app/app.routing.ts @@ -1,4 +1,5 @@ // #docregion +import { ModuleWithProviders } from '@angular/core'; import { Routes, RouterModule } from '@angular/router'; @@ -11,5 +12,5 @@ export const routes: Routes = [ ]; // #docregion forRoot -export const routing = RouterModule.forRoot(routes); +export const routing: ModuleWithProviders = RouterModule.forRoot(routes); // #enddocregion forRoot diff --git a/public/docs/_examples/ngmodule/ts/app/contact/contact.routing.3.ts b/public/docs/_examples/ngmodule/ts/app/contact/contact.routing.3.ts index f90fc36789..5490649283 100644 --- a/public/docs/_examples/ngmodule/ts/app/contact/contact.routing.3.ts +++ b/public/docs/_examples/ngmodule/ts/app/contact/contact.routing.3.ts @@ -1,7 +1,8 @@ +import { ModuleWithProviders } from '@angular/core'; import { RouterModule } from '@angular/router'; import { ContactComponent } from './contact.component.3'; -export const routing = RouterModule.forChild([ +export const routing: ModuleWithProviders = RouterModule.forChild([ { path: 'contact', component: ContactComponent} ]); diff --git a/public/docs/_examples/ngmodule/ts/app/contact/contact.routing.ts b/public/docs/_examples/ngmodule/ts/app/contact/contact.routing.ts index fe9af67fbf..065e78dabd 100644 --- a/public/docs/_examples/ngmodule/ts/app/contact/contact.routing.ts +++ b/public/docs/_examples/ngmodule/ts/app/contact/contact.routing.ts @@ -1,9 +1,10 @@ +import { ModuleWithProviders } from '@angular/core'; import { RouterModule } from '@angular/router'; import { ContactComponent } from './contact.component'; // #docregion routing -export const routing = RouterModule.forChild([ +export const routing: ModuleWithProviders = RouterModule.forChild([ { path: 'contact', component: ContactComponent} ]); // #enddocregion diff --git a/public/docs/_examples/ngmodule/ts/app/crisis/crisis.routing.ts b/public/docs/_examples/ngmodule/ts/app/crisis/crisis.routing.ts index a0e8b850b7..c9aeb83d5f 100644 --- a/public/docs/_examples/ngmodule/ts/app/crisis/crisis.routing.ts +++ b/public/docs/_examples/ngmodule/ts/app/crisis/crisis.routing.ts @@ -1,3 +1,4 @@ +import { ModuleWithProviders } from '@angular/core'; import { Routes, RouterModule } from '@angular/router'; @@ -10,4 +11,4 @@ const routes: Routes = [ { path: ':id', component: CrisisDetailComponent } ]; -export const routing = RouterModule.forChild(routes); +export const routing: ModuleWithProviders = RouterModule.forChild(routes); diff --git a/public/docs/_examples/ngmodule/ts/app/hero/hero.routing.3.ts b/public/docs/_examples/ngmodule/ts/app/hero/hero.routing.3.ts index 181e48faf5..e14d4a7725 100644 --- a/public/docs/_examples/ngmodule/ts/app/hero/hero.routing.3.ts +++ b/public/docs/_examples/ngmodule/ts/app/hero/hero.routing.3.ts @@ -1,3 +1,4 @@ +import { ModuleWithProviders } from '@angular/core'; import { Routes, RouterModule } from '@angular/router'; @@ -15,4 +16,4 @@ const routes: Routes = [ } ]; -export const routing = RouterModule.forChild(routes); +export const routing: ModuleWithProviders = RouterModule.forChild(routes); diff --git a/public/docs/_examples/ngmodule/ts/app/hero/hero.routing.ts b/public/docs/_examples/ngmodule/ts/app/hero/hero.routing.ts index 951ffd7d12..7f364ee988 100644 --- a/public/docs/_examples/ngmodule/ts/app/hero/hero.routing.ts +++ b/public/docs/_examples/ngmodule/ts/app/hero/hero.routing.ts @@ -1,3 +1,4 @@ +import { ModuleWithProviders } from '@angular/core'; import { Routes, RouterModule } from '@angular/router'; @@ -15,4 +16,4 @@ const routes: Routes = [ } ]; -export const routing = RouterModule.forChild(routes); +export const routing: ModuleWithProviders = RouterModule.forChild(routes); diff --git a/public/docs/_examples/router/ts/app/app.routing.1.ts b/public/docs/_examples/router/ts/app/app.routing.1.ts index ccdff404a4..6a420d55ac 100644 --- a/public/docs/_examples/router/ts/app/app.routing.1.ts +++ b/public/docs/_examples/router/ts/app/app.routing.1.ts @@ -1,5 +1,6 @@ // #docplaster // #docregion +import { ModuleWithProviders } from '@angular/core'; // #docregion route-config import { Routes, RouterModule } from '@angular/router'; @@ -36,6 +37,6 @@ export const appRoutingProviders: any[] = [ ]; -export const routing = RouterModule.forRoot(appRoutes); +export const routing: ModuleWithProviders = RouterModule.forRoot(appRoutes); // #enddocregion route-config // #enddocregion diff --git a/public/docs/_examples/router/ts/app/app.routing.2.ts b/public/docs/_examples/router/ts/app/app.routing.2.ts index 81c04c86da..1115c9084e 100644 --- a/public/docs/_examples/router/ts/app/app.routing.2.ts +++ b/public/docs/_examples/router/ts/app/app.routing.2.ts @@ -1,5 +1,6 @@ // #docplaster // #docregion +import { ModuleWithProviders } from '@angular/core'; // #docregion route-config import { Routes, RouterModule } from '@angular/router'; @@ -17,5 +18,5 @@ export const appRoutingProviders: any[] = [ ]; -export const routing = RouterModule.forRoot(appRoutes); +export const routing: ModuleWithProviders = RouterModule.forRoot(appRoutes); // #enddocregion route-config diff --git a/public/docs/_examples/router/ts/app/app.routing.3.ts b/public/docs/_examples/router/ts/app/app.routing.3.ts index 2eab693570..92930849f0 100644 --- a/public/docs/_examples/router/ts/app/app.routing.3.ts +++ b/public/docs/_examples/router/ts/app/app.routing.3.ts @@ -1,5 +1,6 @@ // #docplaster // #docregion +import { ModuleWithProviders } from '@angular/core'; import { Routes, RouterModule } from '@angular/router'; import { CrisisListComponent } from './crisis-center/crisis-list.component'; @@ -12,4 +13,4 @@ export const appRoutingProviders: any[] = [ ]; -export const routing = RouterModule.forRoot(appRoutes); +export const routing: ModuleWithProviders = RouterModule.forRoot(appRoutes); diff --git a/public/docs/_examples/router/ts/app/app.routing.4.ts b/public/docs/_examples/router/ts/app/app.routing.4.ts index 59153e9e53..ff04dd8bfd 100644 --- a/public/docs/_examples/router/ts/app/app.routing.4.ts +++ b/public/docs/_examples/router/ts/app/app.routing.4.ts @@ -1,4 +1,5 @@ // #docregion +import { ModuleWithProviders } from '@angular/core'; import { Routes, RouterModule } from '@angular/router'; const appRoutes: Routes = [ @@ -9,4 +10,4 @@ export const appRoutingProviders: any[] = [ ]; -export const routing = RouterModule.forRoot(appRoutes); +export const routing: ModuleWithProviders = RouterModule.forRoot(appRoutes); diff --git a/public/docs/_examples/router/ts/app/app.routing.5.ts b/public/docs/_examples/router/ts/app/app.routing.5.ts index 8334e865a5..ce153c7b1f 100644 --- a/public/docs/_examples/router/ts/app/app.routing.5.ts +++ b/public/docs/_examples/router/ts/app/app.routing.5.ts @@ -1,4 +1,5 @@ // #docregion +import { ModuleWithProviders } from '@angular/core'; import { Routes, RouterModule } from '@angular/router'; import { loginRoutes, @@ -12,4 +13,4 @@ export const appRoutingProviders: any[] = [ authProviders ]; -export const routing = RouterModule.forRoot(appRoutes); +export const routing: ModuleWithProviders = RouterModule.forRoot(appRoutes); diff --git a/public/docs/_examples/router/ts/app/app.routing.6.ts b/public/docs/_examples/router/ts/app/app.routing.6.ts index 33465b837b..ceee844f0e 100644 --- a/public/docs/_examples/router/ts/app/app.routing.6.ts +++ b/public/docs/_examples/router/ts/app/app.routing.6.ts @@ -1,4 +1,5 @@ // #docregion +import { ModuleWithProviders } from '@angular/core'; // #docregion import-router import { Routes, RouterModule } from '@angular/router'; // #enddocregion import-router @@ -32,7 +33,7 @@ export const appRoutingProviders: any[] = [ CanDeactivateGuard ]; -export const routing = RouterModule.forRoot(appRoutes); +export const routing: ModuleWithProviders = RouterModule.forRoot(appRoutes); // #enddocregion /* A link parameters array diff --git a/public/docs/_examples/router/ts/app/app.routing.ts b/public/docs/_examples/router/ts/app/app.routing.ts index 1e320cffea..bf456cba9a 100644 --- a/public/docs/_examples/router/ts/app/app.routing.ts +++ b/public/docs/_examples/router/ts/app/app.routing.ts @@ -1,4 +1,5 @@ // #docregion +import { ModuleWithProviders } from '@angular/core'; // #docregion import-router import { Routes, RouterModule } from '@angular/router'; // #enddocregion import-router @@ -32,4 +33,4 @@ export const appRoutingProviders: any[] = [ CanDeactivateGuard ]; -export const routing = RouterModule.forRoot(appRoutes); +export const routing: ModuleWithProviders = RouterModule.forRoot(appRoutes); diff --git a/public/docs/_examples/router/ts/app/crisis-center/crisis-center.routing.1.ts b/public/docs/_examples/router/ts/app/crisis-center/crisis-center.routing.1.ts index 0d53587aa4..7c7b913c31 100644 --- a/public/docs/_examples/router/ts/app/crisis-center/crisis-center.routing.1.ts +++ b/public/docs/_examples/router/ts/app/crisis-center/crisis-center.routing.1.ts @@ -1,4 +1,5 @@ // #docregion +import { ModuleWithProviders } from '@angular/core'; import { Routes, RouterModule } from '@angular/router'; import { CrisisDetailComponent } from './crisis-detail.component'; @@ -17,5 +18,5 @@ const crisisCenterRoutes: Routes = [ } ]; -export const crisisCenterRouting = RouterModule.forChild(crisisCenterRoutes); +export const crisisCenterRouting: ModuleWithProviders = RouterModule.forChild(crisisCenterRoutes); // #enddocregion routes diff --git a/public/docs/_examples/router/ts/app/crisis-center/crisis-center.routing.2.ts b/public/docs/_examples/router/ts/app/crisis-center/crisis-center.routing.2.ts index a95ab751f3..07dcf64c81 100644 --- a/public/docs/_examples/router/ts/app/crisis-center/crisis-center.routing.2.ts +++ b/public/docs/_examples/router/ts/app/crisis-center/crisis-center.routing.2.ts @@ -1,4 +1,5 @@ // #docregion +import { ModuleWithProviders } from '@angular/core'; import { Routes, RouterModule } from '@angular/router'; import { CrisisDetailComponent } from './crisis-detail.component'; @@ -24,5 +25,5 @@ const crisisCenterRoutes: Routes = [ } ]; -export const crisisCenterRouting = RouterModule.forChild(crisisCenterRoutes); +export const crisisCenterRouting: ModuleWithProviders = RouterModule.forChild(crisisCenterRoutes); // #enddocregion routes diff --git a/public/docs/_examples/router/ts/app/crisis-center/crisis-center.routing.3.ts b/public/docs/_examples/router/ts/app/crisis-center/crisis-center.routing.3.ts index 8d92662132..77cddebf0e 100644 --- a/public/docs/_examples/router/ts/app/crisis-center/crisis-center.routing.3.ts +++ b/public/docs/_examples/router/ts/app/crisis-center/crisis-center.routing.3.ts @@ -1,5 +1,6 @@ // #docplaster // #docregion +import { ModuleWithProviders } from '@angular/core'; import { Routes, RouterModule } from '@angular/router'; import { CrisisDetailComponent } from './crisis-detail.component'; @@ -38,7 +39,7 @@ const crisisCenterRoutes: Routes = [ } ]; -export const crisisCenterRouting = RouterModule.forChild(crisisCenterRoutes); +export const crisisCenterRouting: ModuleWithProviders = RouterModule.forChild(crisisCenterRoutes); // #enddocregion /* diff --git a/public/docs/_examples/router/ts/app/crisis-center/crisis-center.routing.4.ts b/public/docs/_examples/router/ts/app/crisis-center/crisis-center.routing.4.ts index fa5d1e887c..e21767ecb6 100644 --- a/public/docs/_examples/router/ts/app/crisis-center/crisis-center.routing.4.ts +++ b/public/docs/_examples/router/ts/app/crisis-center/crisis-center.routing.4.ts @@ -1,5 +1,6 @@ // #docplaster // #docregion +import { ModuleWithProviders } from '@angular/core'; import { Routes, RouterModule } from '@angular/router'; import { CrisisDetailComponent } from './crisis-detail.component'; @@ -40,7 +41,7 @@ const crisisCenterRoutes: Routes = [ } ]; -export const crisisCenterRouting = RouterModule.forChild(crisisCenterRoutes); +export const crisisCenterRouting: ModuleWithProviders = RouterModule.forChild(crisisCenterRoutes); // #enddocregion /* diff --git a/public/docs/_examples/router/ts/app/crisis-center/crisis-center.routing.5.ts b/public/docs/_examples/router/ts/app/crisis-center/crisis-center.routing.5.ts index cb7cda5d31..a6fbb5bddf 100644 --- a/public/docs/_examples/router/ts/app/crisis-center/crisis-center.routing.5.ts +++ b/public/docs/_examples/router/ts/app/crisis-center/crisis-center.routing.5.ts @@ -1,5 +1,6 @@ // #docplaster // #docregion +import { ModuleWithProviders } from '@angular/core'; import { Routes, RouterModule } from '@angular/router'; import { CrisisCenterComponent } from './crisis-center.component'; @@ -49,4 +50,4 @@ const crisisCenterRoutes: Routes = [ } ]; -export const crisisCenterRouting = RouterModule.forChild(crisisCenterRoutes); +export const crisisCenterRouting: ModuleWithProviders = RouterModule.forChild(crisisCenterRoutes); diff --git a/public/docs/_examples/router/ts/app/crisis-center/crisis-center.routing.ts b/public/docs/_examples/router/ts/app/crisis-center/crisis-center.routing.ts index 2d044f9de9..77bc573718 100644 --- a/public/docs/_examples/router/ts/app/crisis-center/crisis-center.routing.ts +++ b/public/docs/_examples/router/ts/app/crisis-center/crisis-center.routing.ts @@ -1,5 +1,6 @@ // #docplaster // #docregion +import { ModuleWithProviders } from '@angular/core'; import { Routes, RouterModule } from '@angular/router'; import { CrisisCenterComponent } from './crisis-center.component'; @@ -45,6 +46,6 @@ const crisisCenterRoutes: Routes = [ } ]; -export const crisisCenterRouting = RouterModule.forChild(crisisCenterRoutes); +export const crisisCenterRouting: ModuleWithProviders = RouterModule.forChild(crisisCenterRoutes); // #enddocregion lazy-load-crisis-center // #enddocregion diff --git a/public/docs/_examples/router/ts/app/heroes/heroes.routing.ts b/public/docs/_examples/router/ts/app/heroes/heroes.routing.ts index 89270ec492..4831fdd97b 100644 --- a/public/docs/_examples/router/ts/app/heroes/heroes.routing.ts +++ b/public/docs/_examples/router/ts/app/heroes/heroes.routing.ts @@ -1,4 +1,5 @@ // #docregion +import { ModuleWithProviders } from '@angular/core'; import { Routes, RouterModule } from '@angular/router'; import { HeroListComponent } from './hero-list.component'; @@ -11,5 +12,5 @@ const heroesRoutes: Routes = [ // #enddocregion hero-detail-route ]; -export const heroesRouting = RouterModule.forChild(heroesRoutes); +export const heroesRouting: ModuleWithProviders = RouterModule.forChild(heroesRoutes); // #enddocregion diff --git a/public/docs/_examples/style-guide/ts/app/app.routes.ts b/public/docs/_examples/style-guide/ts/app/app.routes.ts index 3d5d6b3c15..1fb26f08ea 100644 --- a/public/docs/_examples/style-guide/ts/app/app.routes.ts +++ b/public/docs/_examples/style-guide/ts/app/app.routes.ts @@ -1,4 +1,4 @@ -import { RouterConfig } from '@angular/router'; +import { Routes } from '@angular/router'; import { AppComponent as S0101 } from '../01-01/app'; // import { AppComponent as S0207 } from '../02-07/app'; @@ -27,7 +27,7 @@ import { AppComponent as S0101 } from '../01-01/app'; // import { AppComponent as S0704 } from '../07-04/app'; // import { AppComponent as S0901 } from '../09-01/app'; -export const routes: RouterConfig = [ +export const routes: Routes = [ { path: '', redirectTo: '/01-01', pathMatch: 'full' }, { path: '01-01', component: S0101 }, // { path: '02-07', component: S0207 }, @@ -56,4 +56,3 @@ export const routes: RouterConfig = [ // { path: '07-04', component: S0704 }, // { path: '09-01', component: S0901 }, ]; - diff --git a/public/docs/_examples/toh-5/ts/app/app.routing.1.ts b/public/docs/_examples/toh-5/ts/app/app.routing.1.ts index 355c7b31a2..a69db4104b 100644 --- a/public/docs/_examples/toh-5/ts/app/app.routing.1.ts +++ b/public/docs/_examples/toh-5/ts/app/app.routing.1.ts @@ -1,4 +1,5 @@ -// #docregion , heroes +// #docregion , heroes, routing +import { ModuleWithProviders } from '@angular/core'; import { Routes, RouterModule } from '@angular/router'; import { HeroesComponent } from './heroes.component'; @@ -9,6 +10,8 @@ const appRoutes: Routes = [ component: HeroesComponent } ]; -// #enddocregion heroes +// #enddocregion heroes, routing -export const routing = RouterModule.forRoot(appRoutes); +// #docregion routing-export +export const routing: ModuleWithProviders = RouterModule.forRoot(appRoutes); +// #enddocregion routing-export diff --git a/public/docs/_examples/toh-5/ts/app/app.routing.ts b/public/docs/_examples/toh-5/ts/app/app.routing.ts index ba41888354..81f6d05ed2 100644 --- a/public/docs/_examples/toh-5/ts/app/app.routing.ts +++ b/public/docs/_examples/toh-5/ts/app/app.routing.ts @@ -1,5 +1,6 @@ // #docplaster // #docregion , heroes +import { ModuleWithProviders } from '@angular/core'; import { Routes, RouterModule } from '@angular/router'; // #enddocregion heroes @@ -39,5 +40,4 @@ const appRoutes: Routes = [ ]; // #enddocregion heroes -// #docregion routing -export const routing = RouterModule.forRoot(appRoutes); +export const routing: ModuleWithProviders = RouterModule.forRoot(appRoutes); diff --git a/public/docs/_examples/toh-6/ts/app/app.routing.ts b/public/docs/_examples/toh-6/ts/app/app.routing.ts index c5753a4ee9..7acd3b9863 100644 --- a/public/docs/_examples/toh-6/ts/app/app.routing.ts +++ b/public/docs/_examples/toh-6/ts/app/app.routing.ts @@ -1,4 +1,5 @@ // #docregion +import { ModuleWithProviders } from '@angular/core'; import { Routes, RouterModule } from '@angular/router'; import { DashboardComponent } from './dashboard.component'; @@ -25,4 +26,4 @@ const appRoutes: Routes = [ } ]; -export const routing = RouterModule.forRoot(appRoutes); +export const routing: ModuleWithProviders = RouterModule.forRoot(appRoutes); diff --git a/public/docs/ts/latest/guide/router.jade b/public/docs/ts/latest/guide/router.jade index 776ad5b157..1bce217ad6 100644 --- a/public/docs/ts/latest/guide/router.jade +++ b/public/docs/ts/latest/guide/router.jade @@ -106,8 +106,8 @@ include ../_util-fns There are no **leading slashes** in our **path**. The router parses and builds the URL for us, allowing us to use relative and absolute paths when navigating between application views. - The `data` property in the second route is a place to store arbitrary data associated to each - specific route. This data is accessible with each activated route and can be used to store + The `data` property in the second route is a place to store arbitrary data associated with each + specific route. This data is accessible within each activated route and can be used to store items such as page titles, breadcrumb text and other read-only data. We'll use the [resolve guard](#resolve-guard) to retrieve additional data later in the chapter. diff --git a/public/docs/ts/latest/tutorial/toh-pt5.jade b/public/docs/ts/latest/tutorial/toh-pt5.jade index 06b180163a..9f6a7793a1 100644 --- a/public/docs/ts/latest/tutorial/toh-pt5.jade +++ b/public/docs/ts/latest/tutorial/toh-pt5.jade @@ -227,7 +227,7 @@ block router-config-intro We'll export a `routing` constant initialized using the `RouterModule.forRoot` method applied to our !{_array} of routes. This method returns a **configured router module** that we'll add to our root NgModule, `AppModule`. - +makeExcerpt('app/app.routing.ts (excerpt)', 'routing') + +makeExcerpt('app/app.routing.1.ts (excerpt)', 'routing-export') .l-sub-section :marked