Це відео не доступне.
Перепрошуємо.
Resolve Route Guard in Angular | Angular Routing | Angular 13+
Вставка
- Опубліковано 22 бер 2022
- The Angular Resolve route guard or Angular Resolvers allow us to load some data before we navigate to a Route. In this lecture you will learn what is Angular Resolve guard and how to use it in a Angular Application.
The Angular renders the Angular Component, when we navigate to a route. The component will then send an HTTP request to back-end server to fetch data so as to display it to the user. We generally do this in ngOnInit Life cycle hook
The Problem with this approach is that, the user will see a empty component for the time the data is not available. The component will show the data after it arrives. The one way to solve this problem is to show some loading indicator to the user for the time the data is being loaded from server
The another way to solve this is to make use the Resolve route guard. The Resolve route guard pre fetches the data before navigating to the route. Hence the component is rendered along with the data. Lets understand resolve route guard with an example.
DOWNLOAD SECTION SOURCE CODE HERE: drive.google.c...
First of all, sir, I love your lectures, this is the best Angular tutorial I found on UA-cam. I watch your videos several times and learn to program by repeating after you. Huge thanks to you for your work.
I have a small correction for this video though. On the 5:54 timeframe, you say that inside the getAllCourses() method the returning type will be an array of courses (if we will create an interface of courses), but in fact it will be a Promise with the type of courses array. Maybe you mean that too, but when I was trying to implement this I got an error in my IDE. That's why I decided to share it, maybe it will help to someone else who is watching this videos.
And again, thank you so much for your labor!
Best angular tutorial series, i am watching right now. 🔥
Finally I got clarity about resolve route guard, thanks man😍
Great job! I've never seen this technique in the projects before, but it's important in some cases. Thank you for your explanation.
Thank you so much for your explanation. it was very clear for me. Best Regards from Venezuela.
Again great lecture by given you sir, awesome example a lot of information about resolve guard now it's total crystal clear with a dynamic example.
Crystal clear explanations brother
I dont see the point of using a resolver in any application. The user wouldn't know what is going on behind the scenes when the button is clicked and might want to click the button again and again. Can you please give a use case where using a resolver is better
That's right. That's why we need to display a data loading image while tha Data is loading in the background. I will cover how to do that in my next lecture. Stay tuned 🙂
yes it make he confusion in the mind of user either the link is working properly or not.. it is better to use loader to keep user calm that your data is loading wait....
Thank you
can you please give some more examples or real time scenarios where we can use resolve
it is completely useless in real life ...
great video
Can you explain why we are return courseList (which is a Promise) in the getAllCourses. Isn't getAllCourses returning an array of a "Course class model" (we didn't implement the class model for the course).
I have question why we don't use observables methods for similar data that will display what ever data was ready from the whole data?
great!