暂无描述
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

app.routes.ts 670B

12345678910111213
  1. import { Routes } from '@angular/router';
  2. import { LoginComponent } from './pages/login/login.component';
  3. import { HomeComponent } from './components/home.component';
  4. import { ProjectPageComponent } from './pages/project/project-page.component';
  5. import { authGuard } from './guards/auth.guard';
  6. export const routes: Routes = [
  7. { path: 'login', component: LoginComponent },
  8. { path: 'home', component: HomeComponent, canActivate: [authGuard] },
  9. { path: 'project/:projectId', component: ProjectPageComponent, canActivate: [authGuard], runGuardsAndResolvers: 'always' },
  10. { path: '', redirectTo: '/home', pathMatch: 'full' },
  11. { path: '**', redirectTo: '/home' }
  12. ];