dashboard.routes.ts
angular/examples/week05-06/dashboard.routes.ts
// @ts-nocheck
import { Routes } from '@angular/router';
import { provideRouter, withComponentInputBinding } from '@angular/router';
import { DashboardComponent } from './dashboard.component';
import { AuthGuard } from './auth.guard';
import { ProjectsResolver } from './projects.resolver';
export const DASHBOARD_ROUTES: Routes = [
{
path: '',
component: DashboardComponent,
canActivate: [AuthGuard],
resolve: {
projects: ProjectsResolver,
},
children: [
{
path: 'metrics',
loadComponent: () => import('./metrics-widget.component').then((m) => m.MetricsWidgetComponent),
},
{
path: 'activity',
loadComponent: () => import('./activity-feed.component').then((m) => m.ActivityFeedComponent),
},
{
path: '',
pathMatch: 'full',
redirectTo: 'metrics',
},
],
},
];
export const DASHBOARD_PROVIDERS = [provideRouter(DASHBOARD_ROUTES, withComponentInputBinding())];
Artigos relacionados
server.js
server.js — javascript source code from the angular learning materials (angular/comprehensive-demo/server/server.js).
Ler artigo →app.component.ts
app.component.ts — typescript source code from the angular learning materials (angular/comprehensive-demo/src/app/app.component.ts).
Ler artigo →app.config.ts
app.config.ts — typescript source code from the angular learning materials (angular/comprehensive-demo/src/app/app.config.ts).
Ler artigo →app.routes.ts
app.routes.ts — typescript source code from the angular learning materials (angular/comprehensive-demo/src/app/app.routes.ts).
Ler artigo →auth.guard.ts
auth.guard.ts — typescript source code from the angular learning materials (angular/comprehensive-demo/src/app/core/guards/auth.guard.ts).
Ler artigo →role.guard.ts
role.guard.ts — typescript source code from the angular learning materials (angular/comprehensive-demo/src/app/core/guards/role.guard.ts).
Ler artigo →