Angular Route Guard | How to implement CanActivate Interface | Authentication Guard in angular app

preview_player
Показать описание
Share, Support, Subscribe!!

In this video we will learn how to create an authentication guard in angular application.
Basically we will try to learn the use of Angular Route guard.
const routes: Routes = [
{path: '', component: HomeComponent},
{path: 'home', component: HomeComponent},
{path: 'login', component: LoginComponent},
{path: 'register', component: RegisterComponent},
{path: 'addNewCar', component: NewCarComponent, canActivate:[AuthenticationGuard]},
{path: 'logout', component: LogoutComponent}
];
The guard will return true/false and if the value is true then it will continue navigation otherwise not.
Рекомендации по теме
visit shbcf.ru