在角度 2 组件模板中使用锚点,例如
<a href="#somewhere">Scroll/Jump to Somewhere</a>
导致路由消失并使用添加的窗口哈希位置重新加载基本 URL...我做错了什么?
例
活动路由:"http://localhost:4200/help/test
--->单击上面给定的锚点会导致:http://localhost/#somewhere
而不是 http://localhost:4200/help/test#somewhere
<a [routerLink]="['/somewhere']">click to redirect</a>