title: Wait for observable in for loop to finish before continuing loop in Angular 5
body: <p>I'm looping through an array of objects (called projects). The forEach loop contains a service call that returns an observable. I'm trying to wait to process the next project in the array until the observable within the loop completes. What should I use? I tried forkJoin already.</p>
  
  <pre><code>projects
      .forEach(project =&gt; {
          this.imageService.getProjectImages(project.projectId.toString(), true, true, undefined)
              .catch(err =&gt; observer.error(err))
              .finally(() =&gt; {
                  // process next project
              })
              .subscribe((image: FileRepresentation) =&gt; {
                  data.image = image;
                  this.getSlide(project, data);
              });
  })
  </code></pre>