Answer the question
In order to leave comments, you need to log in
How to make links in Angulr behave differently depending on the current route?
The fact is that on the main page these links work like <a href="#Ancor" scrollto="">Ancor link</a>
scrolling. on other pages, we would like us to get to the main page and after that the scroll would be executed. how to implement?
This is SPA
Answer the question
In order to leave comments, you need to log in
If the urls are driven by angular itself, then add some parameter to the router in the rule to the main page, which will be responsible for scrolling somewhere and, if there is something in it, scrolling there directly in the controller of this rule.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question