I am doing recursive call inside for loop, how to know when all calls are done using observables or another technic? The following code is working but I know that there is a better way to do it.
let assync_service_lenght = groups.length;
let assync_count = 0;
groups.forEach(group=> {
//get contacts from groups
this.serviceGroups.getGroupsPeople(group.value).subscribe(res => {
//ADD NEW CONTACT
assync_count++
if(assync_service_lenght==assync_count){
this.sendHTTP(sms);
}
});
});