Skip to content
This repository was archived by the owner on Dec 4, 2017. It is now read-only.

Commit 5104470

Browse files
brandonrobertswardbell
authored andcommitted
docs(router): Removed refs to deprecated router; lowerCamelCase constants
closes #1834
1 parent 761f857 commit 5104470

File tree

22 files changed

+177
-196
lines changed

22 files changed

+177
-196
lines changed

public/docs/_examples/cb-a1-a2-quick-reference/ts/app/app.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ <h1>{{title}}</h1>
44
<h3>Routed Movies</h3>
55
<nav>
66
<!-- #docregion router-link -->
7-
<a [routerLink]="['Movies']">Movies</a>
7+
<a [routerLink]="['/movies']">Movies</a>
88
<!-- #enddocregion router-link -->
99
</nav>
1010
<router-outlet></router-outlet>

public/docs/_examples/cb-a1-a2-quick-reference/ts/app/app.component.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Component } from '@angular/core';
2-
import { RouteConfig, ROUTER_DIRECTIVES, ROUTER_PROVIDERS } from '@angular/router-deprecated';
2+
import { ROUTER_DIRECTIVES } from '@angular/router';
33

44
import { MovieListComponent } from './movie-list.component';
55
import { MovieService } from './movie.service';
@@ -12,11 +12,8 @@ import { StringSafeDatePipe } from './date.pipe';
1212
styleUrls: ['app/app.component.css'],
1313
directives: [MovieListComponent, ROUTER_DIRECTIVES],
1414
pipes: [StringSafeDatePipe],
15-
providers: [MovieService, ROUTER_PROVIDERS]
15+
providers: [MovieService]
1616
})
17-
@RouteConfig([
18-
{path: '/movies', name: 'Movies', component: MovieListComponent, useAsDefault: true}
19-
])
2017
export class AppComponent {
2118

2219
angularDocsUrl = 'https://angular.io/';
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// #docregion
2+
import { provideRouter, RouterConfig } from '@angular/router';
3+
4+
import { MovieListComponent } from './movie-list.component';
5+
6+
const routes: RouterConfig = [
7+
{ path: '', redirectTo: '/movies', pathMatch: 'full' },
8+
{ path: 'movies', component: MovieListComponent }
9+
];
10+
11+
export const appRouterProviders = [
12+
provideRouter(routes)
13+
];
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
// #docregion
2+
import { bootstrap } from '@angular/platform-browser-dynamic';
3+
import { AppComponent } from './app.component';
4+
5+
bootstrap(AppComponent);
Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
// #docregion
22
import { bootstrap } from '@angular/platform-browser-dynamic';
3-
43
import { AppComponent } from './app.component';
4+
import { appRouterProviders } from './app.routes';
55

6-
bootstrap(AppComponent);
6+
bootstrap(AppComponent, [
7+
appRouterProviders
8+
]);

public/docs/_examples/cb-a1-a2-quick-reference/ts/app/movie-list.component.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
// #docplaster
33
// #docregion import
44
import { Component } from '@angular/core';
5-
import { ROUTER_DIRECTIVES } from '@angular/router-deprecated';
65
// #enddocregion import
76
import { MovieService } from './movie.service';
87
import { IMovie } from './movie';
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import { provideRouter, RouterConfig } from '@angular/router';
2+
3+
const routes: RouterConfig = [];
4+
5+
export const appRouterProviders = [
6+
provideRouter(routes)
7+
];

public/docs/_examples/cb-dependency-injection/ts/app/main.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// #docregion
2-
import { bootstrap } from '@angular/platform-browser-dynamic';
3-
import { XHRBackend } from '@angular/http';
4-
import { ROUTER_PROVIDERS } from '@angular/router-deprecated';
2+
import { bootstrap } from '@angular/platform-browser-dynamic';
3+
import { XHRBackend } from '@angular/http';
4+
import { appRouterProviders } from './app.routes';
55
import { LocationStrategy,
66
HashLocationStrategy } from '@angular/common';
77

@@ -13,7 +13,7 @@ import { AppComponent } from './app.component';
1313

1414
// #docregion bootstrap
1515
bootstrap(AppComponent, [
16-
ROUTER_PROVIDERS,
16+
appRouterProviders,
1717
{ provide: LocationStrategy, useClass: HashLocationStrategy },
1818

1919
{ provide: XHRBackend, useClass: InMemoryBackendService }, // in-mem server

public/docs/_examples/router/ts/app/app.component.5.ts

Lines changed: 0 additions & 42 deletions
This file was deleted.

public/docs/_examples/router/ts/app/app.routes.1.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import { HeroDetailComponent } from './heroes/hero-detail.component';
1414

1515
// #docregion
1616
// #docregion route-config
17-
export const routes: RouterConfig = [
17+
const routes: RouterConfig = [
1818
// #docregion route-defs
1919
{ path: 'crisis-center', component: CrisisCenterComponent },
2020
{ path: 'heroes', component: HeroListComponent },

public/docs/_examples/router/ts/app/app.routes.2.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { CrisisListComponent } from './crisis-list.component';
88
import { HeroListComponent } from './hero-list.component';
99

1010
// #docregion route-config
11-
export const routes: RouterConfig = [
11+
const routes: RouterConfig = [
1212
{ path: 'crisis-center', component: CrisisListComponent },
1313
{ path: 'heroes', component: HeroListComponent }
1414
];

public/docs/_examples/style-guide/ts/app/app.routes.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,6 @@ const routes: RouterConfig = [
5656
{ path: '09-01', component: S0901 },
5757
];
5858

59-
export const APP_ROUTER_PROVIDERS = [
59+
export const appRouterProviders = [
6060
provideRouter(routes)
6161
];

public/docs/_examples/style-guide/ts/app/main.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ import { HashLocationStrategy, LocationStrategy } from '@angular/common';
44
import { InMemoryBackendService, SEED_DATA } from 'angular2-in-memory-web-api';
55
import 'rxjs/add/operator/map';
66

7-
import { APP_ROUTER_PROVIDERS } from './app.routes';
7+
import { appRouterProviders } from './app.routes';
88
import { HeroData } from './hero-data';
99
import { AppComponent } from './app.component';
1010

1111
bootstrap(AppComponent, [
12-
APP_ROUTER_PROVIDERS,
12+
appRouterProviders,
1313
HTTP_PROVIDERS,
1414
{ provide: LocationStrategy, useClass: HashLocationStrategy },
1515
{ provide: XHRBackend, useClass: InMemoryBackendService },

public/docs/_examples/toh-5/ts/app/app.routes.1.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { HeroesComponent } from './heroes.component';
66
import { HeroDetailComponent } from './hero-detail.component';
77
// #enddocregion hero-detail-import
88

9-
export const routes: RouterConfig = [
9+
const routes: RouterConfig = [
1010
// #docregion redirect-route
1111
{
1212
path: '',
@@ -32,6 +32,6 @@ export const routes: RouterConfig = [
3232
}
3333
];
3434

35-
export const APP_ROUTER_PROVIDERS = [
35+
export const appRouterProviders = [
3636
provideRouter(routes)
3737
];

public/docs/_examples/toh-5/ts/app/app.routes.2.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@ const routes: RouterConfig = [
99
}
1010
];
1111

12-
export const APP_ROUTER_PROVIDERS = [
12+
export const appRouterProviders = [
1313
provideRouter(routes)
1414
];

public/docs/_examples/toh-5/ts/app/app.routes.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { HeroesComponent } from './heroes.component';
77
import { HeroDetailComponent } from './hero-detail.component';
88
// #enddocregion hero-detail-import
99

10-
export const routes: RouterConfig = [
10+
const routes: RouterConfig = [
1111
{
1212
path: '',
1313
redirectTo: '/dashboard',
@@ -27,6 +27,6 @@ export const routes: RouterConfig = [
2727
}
2828
];
2929

30-
export const APP_ROUTER_PROVIDERS = [
30+
export const appRouterProviders = [
3131
provideRouter(routes)
3232
];

public/docs/_examples/toh-5/ts/app/main.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
import { bootstrap } from '@angular/platform-browser-dynamic';
33

44
import { AppComponent } from './app.component';
5-
import { APP_ROUTER_PROVIDERS } from './app.routes';
5+
import { appRouterProviders } from './app.routes';
66

77
bootstrap(AppComponent, [
8-
APP_ROUTER_PROVIDERS
8+
appRouterProviders
99
]);

public/docs/_examples/toh-6/ts/app/app.routes.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { DashboardComponent } from './dashboard.component';
55
import { HeroesComponent } from './heroes.component';
66
import { HeroDetailComponent } from './hero-detail.component';
77

8-
export const routes: RouterConfig = [
8+
const routes: RouterConfig = [
99
{
1010
path: '',
1111
redirectTo: '/dashboard',
@@ -25,6 +25,6 @@ export const routes: RouterConfig = [
2525
}
2626
];
2727

28-
export const APP_ROUTER_PROVIDERS = [
28+
export const appRouterProviders = [
2929
provideRouter(routes)
3030
];

public/docs/_examples/toh-6/ts/app/main.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,20 @@ import { bootstrap } from '@angular/platform-browser-dynamic';
1212
import { HTTP_PROVIDERS } from '@angular/http';
1313

1414
import { AppComponent } from './app.component';
15-
import { APP_ROUTER_PROVIDERS } from './app.routes';
15+
import { appRouterProviders } from './app.routes';
1616

1717
// #enddocregion v1, final
1818
/*
1919
// #docregion v1
2020
bootstrap(AppComponent, [
21-
APP_ROUTER_PROVIDERS,
21+
appRouterProviders,
2222
HTTP_PROVIDERS
2323
]);
2424
// #enddocregion v1
2525
*/
2626
// #docregion final
2727
bootstrap(AppComponent, [
28-
APP_ROUTER_PROVIDERS,
28+
appRouterProviders,
2929
HTTP_PROVIDERS,
3030
{ provide: XHRBackend, useClass: InMemoryBackendService }, // in-mem server
3131
{ provide: SEED_DATA, useClass: InMemoryDataService } // in-mem server data

0 commit comments

Comments
 (0)