activatedRoute.url.subscribe
都会返回urlsegments
的列表。每当activatedRoute.queryParams.subscribe
发生变化时,queryParams
都会返回 SELECT DISTINCT ch.Date,ID FROM dbo.tblrisk AS rk
inner join (Select TableIdentity, [Date] from tblCommonHistory ) ch
ON ch.TableIDentity = rk.ID order by ID
对象。
我如何订阅这两个,所以在回调中我可以访问最新的url和最新的params?
答案 0 :(得分:0)
您可以使用fork join
Observable.forkJoin(activatedRoute.url, activatedRoute.queryParams)
.subscribe(( a, b ) => { both have resolved here });
请参阅:RxJs:forkJoin