I've got the following TS-method. When I set the two breakpoints #1 and #2 it first hits #1 for all my objects and after that it hits #2 for all my problems.
In my opintion that should be in another order.
public getBuild(val) {
let j_jobs: any;
for (const project of val.projects) {
for (const job of project.jobs) {
this.httpService.get(job.url + 'api/json',
{
headers: new HttpHeaders({
'Content-Type': 'application/json',
'Authorization': 'Basic TOKENREMOVED'
})
})
.subscribe(
data => {
j_jobs = data; //#2
}
);
}
}
console.log(j_jobs); // #1
}```
Can anybody tell me, why angular works like that?