Remove a parameter from queryParams angular 2

前端 未结 9 1271
半阙折子戏
半阙折子戏 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:18

    this.router.navigate([], {
      queryParams: {
        paramName: null,
        paramName2: null,
      },
      queryParamsHandling: 'merge'
    })
    

提交回复
热议问题