AuthGuard added (not working)
This commit is contained in:
parent
12b82d84c1
commit
a126dab147
1 changed files with 20 additions and 5 deletions
|
|
@ -2,20 +2,35 @@ import { NgModule } from '@angular/core';
|
|||
import { RouterModule, Routes } from '@angular/router';
|
||||
import {LoginComponent} from "./login/login.component";
|
||||
import {ChatComponent} from "./chat/chat.component";
|
||||
import {AuthGuard} from "./auth.guard";
|
||||
import {ChangePasswordComponent} from "./change-password/change-password.component";
|
||||
|
||||
const routes: Routes = [
|
||||
// {
|
||||
// path: 'login',
|
||||
// component: LoginComponent,
|
||||
// },
|
||||
// {
|
||||
// path: '',
|
||||
// canActivateChild: [AuthGuard],
|
||||
// children: [
|
||||
// { path: 'chat', component: ChatComponent},
|
||||
// { path: 'changePassword', component: ChangePasswordComponent}
|
||||
// ]
|
||||
// }
|
||||
{
|
||||
path: '',
|
||||
component: LoginComponent,
|
||||
},
|
||||
{
|
||||
path: 'chat',
|
||||
component: ChatComponent,
|
||||
}
|
||||
{ path: 'chat',
|
||||
canActivateChild: [AuthGuard],
|
||||
component: ChatComponent
|
||||
},
|
||||
{ path: 'changePassword', component: ChangePasswordComponent}
|
||||
];
|
||||
|
||||
@NgModule({
|
||||
imports: [RouterModule.forRoot(routes)],
|
||||
exports: [RouterModule]
|
||||
exports: [RouterModule],
|
||||
})
|
||||
export class AppRoutingModule { }
|
||||
|
|
|
|||
Reference in a new issue