title: How to merge looped subscription data angular 2 TS
body: <pre><code>fieldRender(formSets: any[]) {
  
      let questions: any[] = [];
      let q: QuestionBase&lt;any&gt;[] = [];
      let index: number = 0;
  
      formSets.forEach(formSet =&gt; {
        formSet.children.forEach(child =&gt; {
          this.appointmentService.getField(child.field.uuid).subscribe(res =&gt; {
            let dataType;
            let label;
            let parent;
            let uuid;
            let answers = [];
  
            if (res.concept != null) {
              if (res.concept.datatype)
                dataType = res.concept.datatype.display;
              if (res.answers)
                answers = res.answers;
            }
            uuid = res.uuid;
            label = res.display;
            parent = formSet.parent.field.display;
  
            let question: Question = new Question();
            question.label = label;
            question.type = dataType;
            question.parent = parent;
            question.uuid = uuid;
            question.answers = answers;
  
            questions.push(question);
  
            console.log("Questions", JSON.stringify(questions));
          });
        });
      });
  
    }
  </code></pre>
  
  <p>This is my function.What i want this function to return Observable of Questions which i can subscribe to get data anywhere.
  FormSets is an array of FormSet
  FormSet contains a parent and a children array </p>