订阅来自两个不同API的两个响应

时间:2017-10-10 15:20:17

标签: angular rxjs observable

我需要检索并使用来自两个不同API的两个响应。如何订阅来自两个不同API的两个响应?

这是一个类似于我的代码的例子:

this.myService1.getResponse1().subscribe( res1 => this.res1 = res1 );  
this.myService2.getResponse2().subscribe( res2 => this.res2 = res2 );

this.myFunction(this.res1, this.res2);

0 个答案:

没有答案
相关问题