I would like to make a request, that depends on another request, which is within a forkJoin. How do I make the request cleanly, without just calling it within the subscribe of the forkJoin?
Code looks a little bit like this right now: So the inner request in dependent on students in this case. I can't do it, before I don't have received my students from the backend.
forkJoin(
this.service.requestNumber1(...),
this.service.requestNumber2(...),
this.service.requestNumber3(...)
).subscribe(res => {
this.course = res[0];
this.students = res[1];
this.service.innerRequestIWantToReplace(this.students).subscribe(res => {
this.iNeedStudentsForThis = .... ;
});
this.lessonLengthInMinutes = res[2];
});