I am trying to iterate one of my HTTP get() call. It doesn't work properly. I don't know in Angular 6 how can work HTTP method in for loop. Another issue is that If I omit the for loop then the rxjs delay() function doesn't work.
getRoleOftheUser() {
for ( let i = 0; i < this.arr.length; i++) {
return this.http.get<any>(`${this.baseURL}/aaa/groups/${this.arr[i]}/effectiveRolesByUser`)
.pipe(map(res => res) , delay(5000) ).subscribe(result => console.log(result));
}
}
This is not an asynchronous javaScript issue. It's all about rxjs looping. Does anyone please guide me how I can iterate HTTP call in for loop in Angular 6? Thanks