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.
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.
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.
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.
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.
Hi,
very well optimized video it is, time saving and focused on the concept. very nice keep it up.
Thank you so much bro ☺️
Can you please make a video on how to reload/refresh current route on navigating to the current url
Without using using skipLocationChange strategy.
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.
@@WebTechTalk I have tried that,but no luck sir
Ok. I will create a video on that
@@WebTechTalk Thanks sir
That would be really helpful and appreciated.
Hi bro I am getting an error in Angular related to angular core missing dependencies.
Delete your node modules folder and delete your package-lock.json file and then do npm install.
Nice bro 🤝🙌
Thanks 🤗