title: Angular 4 combine data from multiple HTTP requests
body: <p>I'm using angular 4 and I try to get data from 2 endpoints but I have a problem understanding rxjs.</p>
  
  <p>with this code I can only get list of students and users only.</p>
  
  <pre><code> getStudent() {
      return this.http.get(this.url + this.student_url, this.getHeaders()).map(res =&gt; res.json());
    }
  
  getUsers() {
      return this.http.get(this.url + this.users_url, this.getHeaders()).map(res =&gt; res.json());
    }
  </code></pre>
  
  <p>Let's say this is data :
  Student </p>
  
  <pre><code>[{"ID" : 1 , "SchoolCode": "A150", "UserID": 1 }, 
  {"ID" : 5 , "SchoolCode": "A140" , "UserID": 3}, 
  {"ID" : 9 , "SchoolCode": "C140" , "UserID": 4}]
  </code></pre>
  
  <p>User</p>
  
  <pre><code>[{"ID" : 1  ,"Name": "Rick" , "FamilyName" , "Grimes" },
  {"ID" : 4 ,"Name": "Carle" , "FamilyName" , "Grimes" }]
  </code></pre>
  
  <p>I want to get first all students then compare UserID if it's the same as user then I combine both objects into one until I get an array like this :</p>
  
  <pre><code>{"ID" : 1 , "SchoolCode": "A150","Name": "Rick" , "FamilyName" , "Grimes" }
  </code></pre>
  
  <p>I think I should use flatmap but I did try write code but it dosen't work for me and I didn't find an example with such logic.</p>
  
  <p>Could you please help me.</p>