我注意到点击活动路由的链接不再导致组件被重新加载.如何使用新的router3实现此行为?
我的链接看起来像
<a [routerLink]="['/link1']">Link1</a>
而测试我只是在ngOnInit中使用随机数:
export class LinkoneComponent implements OnInit { public foo: number; constructor() {} ngOnInit() { this.foo = Math.floor(Math.random() * 100) + 1; } }
在路由之间切换时,它工作正常,但点击当前活动的路由不会导致组件的重新加载…