If you can help me, please.
I need to make a call in the API but there are a lot of data and I want Angular to wait for this term, at that moment I put a promise but it does not wait and as long as the API is handling the data on the NodeJS side the Angular makes a second call in the API by running over and creating two calls at the command line. My service code:
buscarConsumo(dadosConsumo): Promise<any> {
return this.http.post('${API_AZURE}/buscarconsumoperiodo', dadosConsumo)
.toPromise()
.then((data) => data)
.catch((e) => console.log('Erro na Service', e));
}
My API takes 3 to 4 minutes to finish, I'll handle this in a future bank, but at the moment I need to bring the data to the client side, I tried to put timeout more unsuccessfully.