Remove a parameter from queryParams angular 2

前端 未结 9 1221
半阙折子戏
半阙折子戏 2021-01-31 09:42

I navigate to a certain page in my app with a query parameter. After I get the parameter from the URL I want to delete it, ideally I would have this:



        
9条回答
  •  别那么骄傲
    2021-01-31 10:22

    Imperative method, but cleaner:

    this.router.navigate(['.'], { relativeTo: this.route, queryParams: {} });

提交回复
热议问题