title: How to merge two API response array in one array and returns data Angular 8
body: <p>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.</p>
  <p>below is my service</p>
  <pre><code>getUsersForAdmin() {
      this.budgetaryUnitService.getUserList('Budget Administrator').subscribe(response =&gt; {
        this.adminData = response;
        this.getUsersForViewer();
      });
    }
  
     getUsersForViewer() {
      this.budgetaryUnitService.getUserList('Budget Viewer').subscribe(response =&gt; {
        viewerData = response;
        this.buildData(viewerData);
        this.buildRolesTable(response);
      });
    }
  
  
  
    buildData(this.adminData,viewerData){
      console.log(this.adminData,&quot;Admindata&quot;);
      console.log(viewerData,&quot;viewerData&quot;);
    }
  </code></pre>
  <p><strong>i am getting below response in AdminData.</strong></p>
  <pre><code>var adminData = {
    &quot;limit&quot;: 10,
    &quot;start_offset&quot;: 0,
    &quot;size&quot;: 2,
    &quot;response&quot;: [
      {
        &quot;userid&quot;: &quot;mabasore@us.ibm.com&quot;,
        &quot;firstname&quot;: &quot;Murphy&quot;,
        &quot;lastname&quot;: &quot;Basore&quot;,
        &quot;userstatus&quot;: &quot;Active&quot;
      }
    ]
  }
  </code></pre>
  <p><strong>i am getting below response in viewerData.</strong></p>
  <pre><code>var viewerData = {
    &quot;limit&quot;: 10,
    &quot;start_offset&quot;: 0,
    &quot;size&quot;: 2,
    &quot;response&quot;: [
      {
        &quot;userid&quot;: &quot;harinissb@us.ibm.com&quot;,
        &quot;firstname&quot;: &quot;H&quot;,
        &quot;userstatus&quot;: &quot;Active&quot;
      },
      {
        &quot;userid&quot;: &quot;tarnold@us.ibm.com&quot;,
        &quot;firstname&quot;: &quot;Twana&quot;,
        &quot;userstatus&quot;: &quot;Active&quot;
      }   
    ]
  };
  </code></pre>
  <p><strong>Expected output</strong></p>
  <p>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.</p>
  <pre><code>export const rolesData = {
    'limit': 10,
    'start_offset': 0,
    'result': [
      {
        'name': 'Admin',
        'response': [
          {
              &quot;userid&quot;: &quot;mabasore@us.ibm.com&quot;,
              &quot;firstname&quot;: &quot;Murphy&quot;,
              &quot;lastname&quot;: &quot;Basore&quot;,
              &quot;userstatus&quot;: &quot;Active&quot;
          }
        ]
      },
      {
        'name': 'Viewer',
        'response': [
          {
              &quot;userid&quot;: &quot;harinissb@us.ibm.com&quot;,
              &quot;firstname&quot;: &quot;H&quot;,
              &quot;userstatus&quot;: &quot;Active&quot;
          }
        ]
      }
    ]
  };
  </code></pre>