Ei kuvausta
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

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. ];