A
A
Andrey Prozorov2018-02-08 15:03:14
Angular
Andrey Prozorov, 2018-02-08 15:03:14

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

1 answer(s)
I
ivankomolin, 2018-02-09
@i_d_1

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 question

Ask a Question

731 491 924 answers to any question