title: RxJs / Angular: Fetch additional data via subscription inside a map loop
body: <p>I'm pretty new to angular and rxjs and I just can't get it solved.
  I know my code is wrong, but i don't know how to write it correctly.</p>
  
  <p>I'm fetching a JSON via a HTTP Request, the JSON contains data in an array.
  After that i want to loop through the array inside the JSON data and fetch additional data of another HTTP Endpoint.</p>
  
  <p>I looked into flatMap, switchMap, and so on and I can't figure to combine these commands in my case.</p>
  
  <p>Thank you guys!</p>
  
  <p>My Code so far:</p>
  
  <pre><code>  checkMatches() {
      this.http.get&lt;{
        message: string,
        result: any}&gt;
      (BACKEND_URL + 'matches')
          .pipe(map((matchData) =&gt; {
            return {matches: matchData.result.map(match =&gt; {
              this.userService.getUserData(match.matchedUser).subscribe(userData =&gt; {
                console.log(userData);
              }
                );
              return {
                id: match._id,
                matchedUser: match.matchedUser,
                firstMatch: match.firstMatch,
                name: userData.userName,
                img: userData.userImg,
                status: match.status,
              };
            })};
          }))
          .subscribe(transformedMatchData =&gt; {
          console.log(transformedMatchData);
          });
    }
  </code></pre>