How to keep query parameters in angular 5 on all routes by default?

前端 未结 1 596
孤街浪徒
孤街浪徒 2021-02-02 00:14

Background:

The user calls the app\'s url with the parameters and uses my app. While switching between different routes the url parameters should be kept visible in the

1条回答
  •  北恋
    北恋 (楼主)
    2021-02-02 00:39

    Currently there is no way to set it globally. Using queryParamsHandling seems to be the only option:

    
    

    Or when using router:

    router.navigate('/login', { queryParamsHandling: "preserve" })
    

    The other possible option for queryParamsHandling is merge.

    0 讨论(0)
提交回复
热议问题