can activate is deprecated in angular/router in angular 15+ . So please use can activate as interface now export declare interface CanActivate { canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable | Promise | boolean | UrlTree; } @Injectable() export class AuthGuard implements CanActivate {}
What if we were subsribed to the boolean value of the authentication in courses page ? Could this result in a dynamic response when logout is clicked the user would be redirected to the home page automatically ?
Sir need ur help in CourseGuardService when i put canactivate to 'false' in the navigation bar allow to view the hoem page.follow all ur steps pls guide me which place i did mistake.if i give canactivate true or false in my navigation bar is not respond pls guide me sir
@procademy "CanActivate" guard is deprecated from the start of the Angular 15. But I do not understand the method to resolve it at all. Please update this video.
Can you please post a video on how to implement the same functionality without using the deprecated canActivate
can activate is deprecated in angular/router in angular 15+ . So please use can activate as interface now
export declare interface CanActivate {
canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable | Promise | boolean | UrlTree;
}
@Injectable()
export class AuthGuard implements CanActivate {}
Thanks for nice explanation on 'canActivate', also can you please explain on 'canLoad' and 'resolve' ?
Great vid, route guards are easy!
Nice vedio on canActivate route guard
What if we were subsribed to the boolean value of the authentication in courses page ? Could this result in a dynamic response when logout is clicked the user would be redirected to the home page automatically ?
Sir need ur help in CourseGuardService when i put canactivate to 'false' in the navigation bar allow to view the hoem page.follow all ur steps pls guide me which place i did mistake.if i give canactivate true or false in my navigation bar is not respond pls guide me sir
please i need some help , i try with this but it not work
@procademy "CanActivate" guard is deprecated from the start of the Angular 15. But I do not understand the method to resolve it at all. Please update this video.
just don't implement your class to interface of CanActivate;just use canActivate method as well as before.
@@arammah Thanks. Then what is CanActivateFn?
@@lakshithakanchana6155 canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable | Promise | boolean | UrlTree
@@arammah thanks Aida.
I wanna implement the same guards in ionic angular but its not working, after loging in it should redirect to home page but it stays on login
Can you share the code for CanActivate route which you have implemented.
Are you first returning true and then navigating the user??
good good good