Skip to content
Advertisement

How to merge two API response array in one array and returns data Angular 8

i am calling two different service and getting difrent response. but i want to build one common table after arranging the response of both the service.

below is my service

JavaScript

i am getting below response in AdminData.

JavaScript

i am getting below response in viewerData.

JavaScript

Expected output

If i have AdminData then ‘name’: ‘Admin’, and need to prepare admin respnse. If i have ViewerData then ‘name’: ‘Viewer’, and need to prepare Viewer respnse.

JavaScript

Advertisement

Answer

You can do it with combineLatest.

JavaScript
User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement