我正在尝试使用路由器导航更新查询参数
updateURL(queryParams){
this.router.navigate(['path], {
relativeTo: this.route,
queryParams: queryParams,
queryParamsHandling: 'merge',
skipLocationChange: false
});
}
/** Wont Work
updateURL(queryParams);
updateURL(queryParams);
updateURL(queryParams);
/** Will Work
updateURL(queryParams);
// wait
updateURL(queryParams);
// wait
updateURL(queryParams)
当对该方法进行顺序调用以更新 URL 查询参数时,Angular 不会更新 url。如何处理它,以便即使在进行顺序调用时也能更新 url