Це відео не доступне.
Перепрошуємо.

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...

КОМЕНТАРІ • 17

  • @AnnaBriker
    @AnnaBriker Рік тому +3

    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!

  • @shivpratapshukl5177
    @shivpratapshukl5177 2 роки тому

    Best angular tutorial series, i am watching right now. 🔥

  • @leninnani5222
    @leninnani5222 2 роки тому

    Finally I got clarity about resolve route guard, thanks man😍

  • @sergiocebrian85
    @sergiocebrian85 Рік тому +1

    Great job! I've never seen this technique in the projects before, but it's important in some cases. Thank you for your explanation.

  • @joseusechec.7710
    @joseusechec.7710 Рік тому

    Thank you so much for your explanation. it was very clear for me. Best Regards from Venezuela.

  • @mohammedabdulaziz3658
    @mohammedabdulaziz3658 2 роки тому

    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.

  • @Abdulazizweb
    @Abdulazizweb 9 місяців тому

    Crystal clear explanations brother

  • @atulram8206
    @atulram8206 2 роки тому +3

    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

    • @procademy
      @procademy  2 роки тому +6

      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 🙂

    • @arshadreacts3540
      @arshadreacts3540 Рік тому

      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....

  • @_rachid
    @_rachid Рік тому

    Thank you

  • @SrinathJog
    @SrinathJog Рік тому +1

    can you please give some more examples or real time scenarios where we can use resolve

    • @waelltifi
      @waelltifi Рік тому

      it is completely useless in real life ...

  • @lewispil3529
    @lewispil3529 Рік тому

    great video

  • @danlu1578
    @danlu1578 Рік тому

    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).

  • @ismaeelmoosa1025
    @ismaeelmoosa1025 Рік тому

    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?

  • @Danieloss98
    @Danieloss98 Рік тому

    great!