我有一个问题。步骤如下:
我想在我重新加载主页后,我可以记录我访问过的最新页面是主页。你能帮帮我吗?
在 Angular 中,我可以检测到刷新页面,但我不知道它是在同一页面刷新还是导航到另一个页面:
// Example in the constructor of you App Component
constructor(private router: Router) {
this.subscription = router.events.subscribe((event) => {
if (event instanceof NavigationStart) {
browserRefresh = !router.navigated;
}
});
}```