definma-ui/src/app/app-routing.module.ts

20 lines
525 B
TypeScript
Raw Normal View History

2020-01-14 13:41:28 +01:00
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
2020-05-19 12:49:06 +02:00
import {HomeComponent} from './home/home.component';
2020-05-20 10:07:34 +02:00
import {LoginService} from './login.service';
2020-01-14 13:41:28 +01:00
2020-05-19 12:49:06 +02:00
const routes: Routes = [
2020-05-20 10:07:34 +02:00
{path: '', component: HomeComponent},
{path: 'replace-me', component: HomeComponent, canActivate: [LoginService]},
// if not authenticated
{ path: '**', redirectTo: '' }
2020-05-19 12:49:06 +02:00
];
2020-01-14 13:41:28 +01:00
@NgModule({
imports: [RouterModule.forRoot(routes)],
exports: [RouterModule]
})
export class AppRoutingModule { }