docs(router): more little fixes from #1808
This commit is contained in:
parent
801ac76da0
commit
2c5f0dbd9a
|
@ -24,7 +24,7 @@ export const routes: RouterConfig = [
|
||||||
// #enddocregion hero-detail-route
|
// #enddocregion hero-detail-route
|
||||||
];
|
];
|
||||||
|
|
||||||
export const APP_ROUTER_PROVIDERS = [
|
export const appRouterProviders = [
|
||||||
provideRouter(routes)
|
provideRouter(routes)
|
||||||
];
|
];
|
||||||
// #enddocregion route-config
|
// #enddocregion route-config
|
||||||
|
|
|
@ -13,7 +13,7 @@ export const routes: RouterConfig = [
|
||||||
{ path: 'heroes', component: HeroListComponent }
|
{ path: 'heroes', component: HeroListComponent }
|
||||||
];
|
];
|
||||||
|
|
||||||
export const APP_ROUTER_PROVIDERS = [
|
export const appRouterProviders = [
|
||||||
provideRouter(routes)
|
provideRouter(routes)
|
||||||
];
|
];
|
||||||
// #enddocregion route-config
|
// #enddocregion route-config
|
||||||
|
|
|
@ -1,15 +1,15 @@
|
||||||
// #docplaster
|
// #docplaster
|
||||||
// #docregion
|
// #docregion
|
||||||
import { provideRouter } from '@angular/router';
|
import { provideRouter, RouterConfig } from '@angular/router';
|
||||||
|
|
||||||
import { CrisisListComponent } from './crisis-center/crisis-list.component';
|
import { CrisisListComponent } from './crisis-center/crisis-list.component';
|
||||||
import { HeroesRoutes } from './heroes/heroes.routes';
|
import { heroesRoutes } from './heroes/heroes.routes';
|
||||||
|
|
||||||
export const routes = [
|
export const routes: RouterConfig = [
|
||||||
...HeroesRoutes,
|
...heroesRoutes,
|
||||||
{ path: 'crisis-center', component: CrisisListComponent }
|
{ path: 'crisis-center', component: CrisisListComponent }
|
||||||
];
|
];
|
||||||
|
|
||||||
export const APP_ROUTER_PROVIDERS = [
|
export const appRouterProviders = [
|
||||||
provideRouter(routes)
|
provideRouter(routes)
|
||||||
];
|
];
|
||||||
|
|
|
@ -1,14 +1,14 @@
|
||||||
// #docregion
|
// #docregion
|
||||||
import { provideRouter, RouterConfig } from '@angular/router';
|
import { provideRouter, RouterConfig } from '@angular/router';
|
||||||
|
|
||||||
import { CrisisCenterRoutes } from './crisis-center/crisis-center.routes';
|
import { crisisCenterRoutes } from './crisis-center/crisis-center.routes';
|
||||||
import { HeroesRoutes } from './heroes/heroes.routes';
|
import { heroesRoutes } from './heroes/heroes.routes';
|
||||||
|
|
||||||
export const routes: RouterConfig = [
|
export const routes: RouterConfig = [
|
||||||
...HeroesRoutes,
|
...heroesRoutes,
|
||||||
...CrisisCenterRoutes
|
...crisisCenterRoutes
|
||||||
];
|
];
|
||||||
|
|
||||||
export const APP_ROUTER_PROVIDERS = [
|
export const appRouterProviders = [
|
||||||
provideRouter(routes)
|
provideRouter(routes)
|
||||||
];
|
];
|
||||||
|
|
|
@ -1,19 +1,19 @@
|
||||||
// #docregion
|
// #docregion
|
||||||
import { provideRouter, RouterConfig } from '@angular/router';
|
import { provideRouter, RouterConfig } from '@angular/router';
|
||||||
|
|
||||||
import { CrisisCenterRoutes } from './crisis-center/crisis-center.routes';
|
import { crisisCenterRoutes } from './crisis-center/crisis-center.routes';
|
||||||
import { HeroesRoutes } from './heroes/heroes.routes';
|
import { heroesRoutes } from './heroes/heroes.routes';
|
||||||
|
|
||||||
import { LoginRoutes,
|
import { loginRoutes,
|
||||||
AUTH_PROVIDERS } from './login.routes';
|
authProviders } from './login.routes';
|
||||||
|
|
||||||
export const routes: RouterConfig = [
|
export const routes: RouterConfig = [
|
||||||
...HeroesRoutes,
|
...heroesRoutes,
|
||||||
...LoginRoutes,
|
...loginRoutes,
|
||||||
...CrisisCenterRoutes
|
...crisisCenterRoutes
|
||||||
];
|
];
|
||||||
|
|
||||||
export const APP_ROUTER_PROVIDERS = [
|
export const appRouterProviders = [
|
||||||
provideRouter(routes),
|
provideRouter(routes),
|
||||||
AUTH_PROVIDERS
|
authProviders
|
||||||
];
|
];
|
||||||
|
|
|
@ -1,22 +1,22 @@
|
||||||
// #docregion
|
// #docregion
|
||||||
import { provideRouter, RouterConfig } from '@angular/router';
|
import { provideRouter, RouterConfig } from '@angular/router';
|
||||||
|
|
||||||
import { CrisisCenterRoutes } from './crisis-center/crisis-center.routes';
|
import { crisisCenterRoutes } from './crisis-center/crisis-center.routes';
|
||||||
import { HeroesRoutes } from './heroes/heroes.routes';
|
import { heroesRoutes } from './heroes/heroes.routes';
|
||||||
|
|
||||||
import { LoginRoutes,
|
import { loginRoutes,
|
||||||
AUTH_PROVIDERS } from './login.routes';
|
authProviders } from './login.routes';
|
||||||
|
|
||||||
import { CanDeactivateGuard } from './interfaces';
|
import { CanDeactivateGuard } from './interfaces';
|
||||||
|
|
||||||
export const routes: RouterConfig = [
|
export const routes: RouterConfig = [
|
||||||
...HeroesRoutes,
|
...heroesRoutes,
|
||||||
...LoginRoutes,
|
...loginRoutes,
|
||||||
...CrisisCenterRoutes
|
...crisisCenterRoutes
|
||||||
];
|
];
|
||||||
|
|
||||||
export const APP_ROUTER_PROVIDERS = [
|
export const appRouterProviders = [
|
||||||
provideRouter(routes),
|
provideRouter(routes),
|
||||||
AUTH_PROVIDERS,
|
authProviders,
|
||||||
CanDeactivateGuard
|
CanDeactivateGuard
|
||||||
];
|
];
|
||||||
|
|
|
@ -5,7 +5,7 @@ import { CrisisListComponent } from './crisis-list.component';
|
||||||
import { CrisisCenterComponent } from './crisis-center.component';
|
import { CrisisCenterComponent } from './crisis-center.component';
|
||||||
|
|
||||||
// #docregion routes
|
// #docregion routes
|
||||||
export const CrisisCenterRoutes: RouterConfig = [
|
export const crisisCenterRoutes: RouterConfig = [
|
||||||
{
|
{
|
||||||
path: 'crisis-center',
|
path: 'crisis-center',
|
||||||
component: CrisisCenterComponent,
|
component: CrisisCenterComponent,
|
||||||
|
|
|
@ -5,7 +5,7 @@ import { CrisisListComponent } from './crisis-list.component';
|
||||||
import { CrisisCenterComponent } from './crisis-center.component';
|
import { CrisisCenterComponent } from './crisis-center.component';
|
||||||
|
|
||||||
// #docregion routes
|
// #docregion routes
|
||||||
export const CrisisCenterRoutes: RouterConfig = [
|
export const crisisCenterRoutes: RouterConfig = [
|
||||||
// #docregion redirect
|
// #docregion redirect
|
||||||
{
|
{
|
||||||
path: '',
|
path: '',
|
||||||
|
|
|
@ -8,7 +8,7 @@ import { CrisisAdminComponent } from './crisis-admin.component';
|
||||||
|
|
||||||
import { CanDeactivateGuard } from '../interfaces';
|
import { CanDeactivateGuard } from '../interfaces';
|
||||||
|
|
||||||
export const CrisisCenterRoutes: RouterConfig = [
|
export const crisisCenterRoutes: RouterConfig = [
|
||||||
{
|
{
|
||||||
path: '',
|
path: '',
|
||||||
redirectTo: '/crisis-center',
|
redirectTo: '/crisis-center',
|
||||||
|
|
|
@ -9,7 +9,7 @@ import { CrisisAdminComponent } from './crisis-admin.component';
|
||||||
import { CanDeactivateGuard } from '../interfaces';
|
import { CanDeactivateGuard } from '../interfaces';
|
||||||
import { AuthGuard } from '../auth.guard';
|
import { AuthGuard } from '../auth.guard';
|
||||||
|
|
||||||
export const CrisisCenterRoutes: RouterConfig = [
|
export const crisisCenterRoutes: RouterConfig = [
|
||||||
{
|
{
|
||||||
path: '',
|
path: '',
|
||||||
redirectTo: '/crisis-center',
|
redirectTo: '/crisis-center',
|
||||||
|
|
|
@ -8,7 +8,7 @@ import { CrisisAdminComponent } from './crisis-admin.component';
|
||||||
import { CanDeactivateGuard } from '../interfaces';
|
import { CanDeactivateGuard } from '../interfaces';
|
||||||
import { AuthGuard } from '../auth.guard';
|
import { AuthGuard } from '../auth.guard';
|
||||||
|
|
||||||
export const CrisisCenterRoutes: RouterConfig = [
|
export const crisisCenterRoutes: RouterConfig = [
|
||||||
{
|
{
|
||||||
path: '',
|
path: '',
|
||||||
redirectTo: '/crisis-center',
|
redirectTo: '/crisis-center',
|
||||||
|
|
|
@ -3,7 +3,7 @@ import { RouterConfig } from '@angular/router';
|
||||||
import { HeroListComponent } from './hero-list.component';
|
import { HeroListComponent } from './hero-list.component';
|
||||||
import { HeroDetailComponent } from './hero-detail.component';
|
import { HeroDetailComponent } from './hero-detail.component';
|
||||||
|
|
||||||
export const HeroesRoutes: RouterConfig = [
|
export const heroesRoutes: RouterConfig = [
|
||||||
{ path: 'heroes', component: HeroListComponent },
|
{ path: 'heroes', component: HeroListComponent },
|
||||||
// #docregion hero-detail-route
|
// #docregion hero-detail-route
|
||||||
{ path: 'hero/:id', component: HeroDetailComponent }
|
{ path: 'hero/:id', component: HeroDetailComponent }
|
||||||
|
|
|
@ -1,10 +1,11 @@
|
||||||
// #docregion
|
// #docregion
|
||||||
|
import { RouterConfig } from '@angular/router';
|
||||||
import { AuthGuard } from './auth.guard';
|
import { AuthGuard } from './auth.guard';
|
||||||
import { AuthService } from './auth.service';
|
import { AuthService } from './auth.service';
|
||||||
import { LoginComponent } from './login.component';
|
import { LoginComponent } from './login.component';
|
||||||
|
|
||||||
export const LoginRoutes = [
|
export const loginRoutes: RouterConfig = [
|
||||||
{ path: 'login', component: LoginComponent }
|
{ path: 'login', component: LoginComponent }
|
||||||
];
|
];
|
||||||
|
|
||||||
export const AUTH_PROVIDERS = [AuthGuard, AuthService];
|
export const authProviders = [AuthGuard, AuthService];
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
// main entry point
|
// main entry point
|
||||||
import { bootstrap } from '@angular/platform-browser-dynamic';
|
import { bootstrap } from '@angular/platform-browser-dynamic';
|
||||||
import { AppComponent } from './app.component';
|
import { AppComponent } from './app.component';
|
||||||
import { APP_ROUTER_PROVIDERS } from './app.routes';
|
import { appRouterProviders } from './app.routes';
|
||||||
|
|
||||||
// #enddocregion
|
// #enddocregion
|
||||||
|
|
||||||
|
@ -19,7 +19,7 @@ import { AppComponent as ac } from './app.component.ts'; // './app.component.1';
|
||||||
|
|
||||||
bootstrap(ac, [
|
bootstrap(ac, [
|
||||||
// #docregion all
|
// #docregion all
|
||||||
APP_ROUTER_PROVIDERS
|
appRouterProviders
|
||||||
])
|
])
|
||||||
.catch(err => console.error(err));
|
.catch(err => console.error(err));
|
||||||
// #enddocregion all
|
// #enddocregion all
|
||||||
|
|
|
@ -11,7 +11,7 @@ import { LocationStrategy,
|
||||||
HashLocationStrategy } from '@angular/common';
|
HashLocationStrategy } from '@angular/common';
|
||||||
|
|
||||||
import { AppComponent } from './app.component';
|
import { AppComponent } from './app.component';
|
||||||
import { APP_ROUTER_PROVIDERS } from './app.routes';
|
import { appRouterProviders } from './app.routes';
|
||||||
|
|
||||||
// #enddocregion
|
// #enddocregion
|
||||||
|
|
||||||
|
@ -25,7 +25,7 @@ import { AppComponent as ac } from './app.component.ts'; // './app.component.2';
|
||||||
|
|
||||||
bootstrap(ac, [
|
bootstrap(ac, [
|
||||||
// #docregion
|
// #docregion
|
||||||
APP_ROUTER_PROVIDERS,
|
appRouterProviders,
|
||||||
{ provide: LocationStrategy, useClass: HashLocationStrategy } // .../#/crisis-center/
|
{ provide: LocationStrategy, useClass: HashLocationStrategy } // .../#/crisis-center/
|
||||||
|
|
||||||
])
|
])
|
||||||
|
|
|
@ -3,9 +3,9 @@
|
||||||
// main entry point
|
// main entry point
|
||||||
import { bootstrap } from '@angular/platform-browser-dynamic';
|
import { bootstrap } from '@angular/platform-browser-dynamic';
|
||||||
import { AppComponent } from './app.component.3';
|
import { AppComponent } from './app.component.3';
|
||||||
import { APP_ROUTER_PROVIDERS } from './app.routes';
|
import { appRouterProviders } from './app.routes';
|
||||||
|
|
||||||
bootstrap(AppComponent, [
|
bootstrap(AppComponent, [
|
||||||
APP_ROUTER_PROVIDERS
|
appRouterProviders
|
||||||
])
|
])
|
||||||
.catch(err => console.error(err));
|
.catch(err => console.error(err));
|
||||||
|
|
|
@ -2,9 +2,9 @@
|
||||||
// main entry point
|
// main entry point
|
||||||
import { bootstrap } from '@angular/platform-browser-dynamic';
|
import { bootstrap } from '@angular/platform-browser-dynamic';
|
||||||
import { AppComponent } from './app.component';
|
import { AppComponent } from './app.component';
|
||||||
import { APP_ROUTER_PROVIDERS } from './app.routes';
|
import { appRouterProviders } from './app.routes';
|
||||||
|
|
||||||
bootstrap(AppComponent, [
|
bootstrap(AppComponent, [
|
||||||
APP_ROUTER_PROVIDERS
|
appRouterProviders
|
||||||
])
|
])
|
||||||
.catch(err => console.error(err));
|
.catch(err => console.error(err));
|
||||||
|
|
Loading…
Reference in New Issue