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