Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

routerLink appends my link

Tags:

angular

I have a menu navigation component that appears on all pages:

I have some links like this: - Following - Followers

When I'm on http://localhost/#/ the links are created ok eg :

- http://localhost/#/network;scrollTo=%23Following
- http://localhost/#/network;scrollTo=%23Followers

But If I click on one the other shows something like this :

- http://localhost/#/network;scrollTo=%23Following/(network;scrollTo=%23Followers)

How can I reset this?

like image 761
Gerald Hughes Avatar asked Oct 18 '16 08:10

Gerald Hughes


1 Answers

You are using relative urls, that's why routerLink keeps appending them. You should check the Relative Navigation documentation.

No slash in the biggining or ./ means a relative url to the current one

A starting slash means an absolute url

like image 54
Fabio Antunes Avatar answered Oct 02 '22 08:10

Fabio Antunes