Subscribe to both route params and queryParams in Angular 2

前端 未结 7 1879
粉色の甜心
粉色の甜心 2020-12-14 00:45

I have set up the following routing system

export const MyRoutes: Routes = [
  {path: \'\', redirectTo         


        
7条回答
  •  醉梦人生
    2020-12-14 01:13

    I think you should use zip operator https://www.learnrxjs.io/operators/combination/zip.html

    Because if you use combineLatest and change url params or query params you got value with new query params and old url params.

    Urls for example:

    http://localhost/1?value=10

    http://localhost/2?value=20

    http://localhost/3?value=30

提交回复
热议问题