如何处理路由参数和 API 服务的这些嵌套订阅?

How to handle these nested subscription for route Param and API service?

this.route.params.subscribe(params => {
  if (params.id) {
    this.formService.getFormFieldValById(params.id).pipe(take(1)).subscribe(res => {
        // bind response to form
    });
  }
});
this.route.queryParams.pipe(
  switchMap(({id}) => {
    return this.formService.getFormFieldValById(id);
  })
).subscribe(res => {
    // bind response to form      
})

在这里您可以链接每个进程而不是嵌套订阅