0

I am working in Angular 16 project. previously i used below code. but it is not working for Angular 16 error sair 'CanActivate' is deprecated.ts(6385)

this is my code

`const routes: Routes = [
{
    path: '',
    canActivate: [AuthGuard],
    loadChildren: () => import('./layout/layout.module').then(m => m.LayoutModule)
},
{
    path: 'login',
    loadChildren: () => import('./login/login.module').then(m => m.LoginModule)
},
{
path: 'resetpassword',
loadChildren: () => import('./reset-password/reset-password.module').then(m => m.ResetPasswordModule)

},

{ path: '**', redirectTo: 'not-found' }

];`

how i do this according to Angular 16

Kumara
  • 471
  • 2
  • 10
  • 33

0 Answers0