#88 Retrieving Route Parameter Value | Angular Router & Route Guards | A Complete Angular Course

Поделиться
HTML-код
  • Опубликовано: 16 янв 2025

Комментарии • 13

  • @ansumanpanigrahi9128
    @ansumanpanigrahi9128 Год назад +2

    what a great practical use case of an observable . Thank u !!!!!!!!!!!

  • @SuperCeylonASMR
    @SuperCeylonASMR 4 месяца назад

  • @dr.faithadhiambo254
    @dr.faithadhiambo254 9 месяцев назад

    Thank you sir!

  • @KratiVarshney-i1p
    @KratiVarshney-i1p 29 дней назад

    Hi sir, i have one doubt in this lecture as you said that ngOnInit gets called once whenever component gets load right? but as in previous button and next button we are adding and subtracting the id that means somewhere we are changing the route and as we change the route it should go to routes and load the course-detail component again and as it loads it should execute the ngOnInit once again. so why we have to use subscribe.
    Please explain me as this, as i having this as a doubt.

  • @NireeshaNarendula
    @NireeshaNarendula Год назад +1

    Hi Sir, From this session I understood that paramMap or params observable is used instead of snapshot as these observables emit new value when a route parameter gets changed. I am confused as we are using these observables in ngOnInit hook as I am assuming ngOnInit hook gets called only once, how come the observables in ngOnInit are updated whenever route parameter is changed.

    • @procademy
      @procademy  Год назад +4

      Hi there. Let me try to explain in a simple way. We need to subscribe to an observable only once. And that we are doing in ngOnInt. As you rightly said, ngOnInit will be called only once and at that time we are subscribing to the param or paramMap observable.
      Now everytime the observable will emit a new value, since we have subscribed to it, the next callback function passed to subscribe method will be called.
      Remember that ngOnInit is not getting executed again. It's the next callback function which is getting called, whenever the observable emits a new value. I hope i have cleared your doubt.
      If you still have questions, please watch observable related lectures from this playlist.

    • @NireeshaNarendula
      @NireeshaNarendula Год назад

      @@procademy Thank you very much for the detailed explanation sir.

    • @ahmadbinwaris9515
      @ahmadbinwaris9515 10 месяцев назад

      @@procademy Thank You Sir! I was also confused in this scenario.

  • @Manojkumar-vl6hi
    @Manojkumar-vl6hi 6 месяцев назад

    hi sir, here what is the meaning of initialisation, i mean in courses page, when we click details of one course it will render that particular course detail and when we come back and if we click on other course details it will render that particular course. but this is not case with previous and next. so my doubt is in course page also we initialised for first course detail, when we come back and click on next course details it should not show the next one. but how it is showing.

  • @KishanDudhat-fy1le
    @KishanDudhat-fy1le Год назад

    Sir also make a videos of Angular Universal, Ssr, lazy loading, Angular 17 new features in this tutorial series

  • @PratikP-j1f
    @PratikP-j1f 10 месяцев назад

    so Josef Stalin is your student

  • @vipultyagi2442
    @vipultyagi2442 10 месяцев назад +1

    PrevCourseButtonClicked(){
    this.selectedId--;
    this.router.navigate(['Courses','Course',this.selectedId]);
    }
    NextCourseButtonClicked(){
    this.selectedId++;
    this.router.navigate(['Courses','Course',this.selectedId]);
    }
    why this is not working?

  • @dr.faithadhiambo254
    @dr.faithadhiambo254 9 месяцев назад

    Thank you sir!