【发布时间】:2020-05-06 02:24:23
【问题描述】:
我从页面顶部的导航栏组件执行搜索。 从导航栏输入搜索条件时,我可以路由到我的“成员”组件页面,但是一旦我在“成员”组件上并更改查询参数并尝试再次运行 router.navigate() 我无法让 Angular 访问我的解析器。
这是我所做的以及我在导航调用上方尝试的操作,ReuseRoute 或 onSameUrlNavigation 似乎都无法在组件上再次点击我的解析器。
问题是——应该吗?因为也许我在某个地方出了点问题!
// tried with no luck
this.router.routeReuseStrategy.shouldReuseRoute = () => false;
// tried with no luck
this.router.onSameUrlNavigation = 'reload';
this.router.navigate(['/members'], {
queryParams: {
latitude: this.locationLatitude,
longitude: this.locationLongitude,
gender: this.gender,
minAge: this.ageFrom,
maxAge: this.ageTo,
orderBy: this.orderBy
}
});
【问题讨论】:
标签: javascript angular angular-routing angular-resolver