Dav*_*lug 12 javascript typescript angular
我想知道在使用角度路由器导航到不同的"视图"之后是否有办法执行某些操作.
this.router.navigate(["/search", "1", ""]);
// Everything after navigate does not not get executed.
this.sideFiltersService.discoverFilter(category);
gab*_*nal 25
this.router.navigate返回一个promise,所以你可以简单地使用:
this.router.navigate(["/search", "1", ""]).then(()=>{
  // do whatever you need after navigation succeeds
});| 归档时间: | 
 | 
| 查看次数: | 10490 次 | 
| 最近记录: |