I have multiple methods that contain individual get
method but in component How to Call Multiple Rest API and Subscribe in component i.e. calling multiple methods in one subscribe.
/**
* Get current User from the server.
*
* @returns {json} current user.
*/
public getCurrentUser(): any {
return this.http.get(this.baseUrl)
.pipe(map((res: any) => res.data));
}
/**
* Get all device statuses from the server.
*
* @returns {json} all asset statuses.
*/
public getDeviceConditions(): any {
return this.http.get(this.baseUrl)
.pipe(map((res: any) => res.data));
}
假设我想用一个订阅调用以上两种方法。
pre
& code
tags ):