Clear all queryParams with new Router v3 Angular2

后端 未结 3 1251
栀梦
栀梦 2021-01-17 08:00

I\'m trying to figure out how to use the Angular2 router navigation (router 3.0.0-alpha.7) with query parameters.

I can easily navigate to a route with a queryParam

3条回答
  •  孤街浪徒
    2021-01-17 08:55

    You can simply use preserveQueryParams: false parameter to ignore query params

    this.router.navigate(['target'], {preserveQueryParams: false});
    

提交回复
热议问题