I need to subscribe to two http calls, and make sure don't fail after that , I want to apply a filter on the arrays that I get in const array.
const result =[]
this.fncservice.obs.subscribe((response)=>this.fncservice.maptofncbyetat(response,this.fnc,"en cours"));
this.analysefncservice.obs.subscribe((response)=>this.analysefncservice.maptoplanactionbyetat(response,this.analysefncs,"en cours"));
// the filter
this.fnc.forEach((filter) => {
if (
!this.analysefncs
.filter((condition) => condition.n_fnc == filter.n_fnc)
.some((nc) => nc.etat != "act")
) {
console.log("succes" , filter.n_fnc)
result.push(filter.n_fnc);
}
});
});
the problem that I get null in result . How to use forkjoin or switchmap to asynch my service call and apply the filter when the calls is end ?
});somehow - I'm surprised this compiles for you.