Topic: On tab click change url with hashtag
Hi,
I am using tabs component on one of my pages. I would like to achieve that by clicking on one of the tabs url would change from something like this: /user/321 to this: /user/321#friendlist
By this I would like to achieve that by following link: /user/321#friendlist, list of friends tab would be selected. Is there a tutorial that would help me achieve that?
Damian Gemza staff answered 6 years ago
Dear @maticdiba
You have to search the Internet for some tutorials because your question is not directly related to the MDB but to the Angular itself.
Please check this link. Maybe this will answer your question.
Best Regards,
Damian
maticdiba pro answered 6 years ago
Thank you for your answer. I tried this approach, but when I try to use the parameter and programatically set active tab with:
Arkadiusz Idzikowski staff commented 6 years ago
You need to call this method in ngAfterViewInit hook.
maticdiba pro commented 6 years ago
That worked. I was sure that I used it in ngInit before. Thank you for your help.
FREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Answered
- User: Pro
- Premium support: No
- Technology: MDB Angular
- MDB Version: 7.0.0
- Device: computer
- Browser: chrome
- OS: windows
- Provided sample code: No
- Provided link: No