navigate vs navigateByUrl: Understanding the Differences for Interviews | Angular Interview Concepts

Поділитися
Вставка
  • Опубліковано 11 вер 2024

КОМЕНТАРІ • 13

  • @MinhNguyen-zx8me
    @MinhNguyen-zx8me Рік тому +1

    There is a gotcha part in here that you did not mention, and that is the shared service. The fact that the counter variable is defined in here also plays an important part where using either of the navigate method won't reset its value. If you put the variable inside the component, its value will be reset back to 0. It's worth to mention that to your users.

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

      I used the counter in the shared service just to explain the difference between navigation through href and angular routing. Anyway, thanks for mentioning about what will happen when we have the counter inside the component.

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

    Hi,
    very well optimized video it is, time saving and focused on the concept. very nice keep it up.

  • @talib7508
    @talib7508 2 роки тому +2

    Can you please make a video on how to reload/refresh current route on navigating to the current url
    Without using using skipLocationChange strategy.

    • @WebTechTalk
      @WebTechTalk  2 роки тому +1

      There is another option which we can set in the RouterModule. Something like, RouterModule.forRoot(routes, {onSameUrlNavigation: 'reload'}). You can try this, if it is not working, I will try to create a video explaining that concept.

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

      @@WebTechTalk I have tried that,but no luck sir

    • @WebTechTalk
      @WebTechTalk  2 роки тому +1

      Ok. I will create a video on that

    • @talib7508
      @talib7508 2 роки тому +2

      @@WebTechTalk Thanks sir
      That would be really helpful and appreciated.

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

    Hi bro I am getting an error in Angular related to angular core missing dependencies.

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

      Delete your node modules folder and delete your package-lock.json file and then do npm install.

  • @oneough
    @oneough 2 роки тому +1

    Nice bro 🤝🙌