更新时间:2023-11-28 22:29:04
感谢大家的回答.这是我发现我必须要做的.
Thanks everyone for the answers. Here is what I found that I had to do.
router.events.subscribe((event: Event) => {
console.log(event);
if (event instanceof NavigationEnd ) {
this.currentUrl = event.url;
}
});