So I used the following post to figure out how to add a fragment to the url.
Angular2 Routing with Hashtag to page anchor
And the fragment gets added fine, however the page doesn't move to the resulting anchor. I have tried using both the name
and id
attribute on the destination div
, but neither seem to work.
I'm using Angular Version 2.0.0-rc.3, and router version 3.0.0-alpha.6.
Thanks!
<a [routerLink]="[]" fragment="destination">Go TO DIV</a>
<div id='destination'>
<h2>Destination</h2>
</div>
There is enough space between the 2 elements to tell if the page actually moves.
And as said before, the url correctly adds #destination
to itself.