Hi Venkat I am getting below error msg when i am writing this line of code "const employeeExists = this._employeeService.getEmployee(route.paramMap.get('Name')); //Instead of "Id" i used "Name" // Error msg:- error TS2554: Expected 0 arguments, but got 1. error TS2554: Expected 0 arguments, but got 1.
Bro you are using canActivate without lazyloading modules is there anyway to use with lazy load modules i am getting function gaurd is not found for lazy load modules i know if i declare them in main app. Module they will be laoded
this is awesome, but Can you please tell me If I want to restrict a user from a specific HTML element / typescript method/ function inside the component(some functions/ elements should be accessible but some should not), thank you.
Nice explanation wrt Guards. But in employee exist scenario we will be calling get employees twice (one in Guards and another in its component )and it may affect the performance. correct me if I am wrong
Hi sir, it is not working for me. I am getting error as Uncaught (in promise): TypeError: Cannot read property 'get' of undefined.can you help me..I am new to angular.
Hello Gowtham - Both are route guards and are used for different use cases. CanDeactivate Guard, guards navigation away from the current route where as CanActivate Guard, guards navigation to a route. For example, canActivate guard is used to check if the user is authorised to access a specific route. Non admin users should not be able to access admin routes. This is one use case for canActivate guard. CanDeactivate Guard, guards navigation away from the current route. For example, if you have a data entry form and you want to protect accidentally navigating away from the form, so we do not lose the data enetered so far. This is one use case for CanDeactivate Guard. Hope this answers your question.
Hi Venkat, I like the way you explain with an almost a real example.
Thank you sir, its really a good video, keep it up and provide more
thanks. very good explanation.. Great job keep it up
!! Is always returning me true value... I am using angular 9
hi venkat , what if we change some thing other than 'id' . it is not working..
time can pass but your videos are always great. Thanks a lot again
Thank you and great tutorial for beginners...
Hi Venkat
I am getting below error msg when i am writing this line of code "const employeeExists = this._employeeService.getEmployee(route.paramMap.get('Name')); //Instead of "Id" i used "Name" //
Error msg:- error TS2554: Expected 0 arguments, but got 1.
error TS2554: Expected 0 arguments, but got 1.
16 const employeeExists = !!this._employeeService.getEmployee(route.paramMap.get('Name'));
what are scenario where we can use custom directives in projects??
Thanks for the wonderful video.
Thank you sir for ur excellent explanation for Angular
route guard , plz update canactivatechild and canload route guard..
Bro you are using canActivate without lazyloading modules is there anyway to use with lazy load modules i am getting function gaurd is not found for lazy load modules i know if i declare them in main app. Module they will be laoded
I don't have I'd in route then ...what we will be use.
this is awesome, but Can you please tell me If I want to restrict a user from a specific HTML element / typescript method/ function inside the component(some functions/ elements should be accessible but some should not), thank you.
Nice explanation wrt Guards. But in employee exist scenario we will be calling get employees twice (one in Guards and another in its component )and it may affect the performance. correct me if I am wrong
Hi sir, it is not working for me. I am getting error as Uncaught (in promise): TypeError: Cannot read property 'get' of undefined.can you help me..I am new to angular.
Thank you. Can you please make a video on how to debug the application. It's very important
great tutorial, ya da man as always
Crystal clear
Thank u sir u create a excellent content for us you are role model for many students but every want to know about you please make a video on self
hi venkat , can you please explain the exact difference between canActivate and canDeactivate
Hello Gowtham - Both are route guards and are used for different use cases. CanDeactivate Guard, guards navigation away from the current route where as CanActivate Guard, guards navigation to a route.
For example, canActivate guard is used to check if the user is authorised to access a specific route. Non admin users should not be able to access admin routes. This is one use case for canActivate guard.
CanDeactivate Guard, guards navigation away from the current route. For example, if you have a data entry form and you want to protect accidentally navigating away from the form, so we do not lose the data enetered so far. This is one use case for CanDeactivate Guard.
Hope this answers your question.
Nice sir I am a big fan
Good Stuff!!
Calling service get request and How can i return observable in guard please tell the implementation
what will happen when we refresh the page....?
great. Thanks bro
nice explanation,
ty sir
that !! blew me away damn! I'm new to this so yeah!
Thank You ...
So useful
If there is no id in URL normal string then
Can I get the source code
please Laravel Tutorial.