await this.configurationService.deleteTrf(this.trfCode);
this.afterStatusChange();
deleteTrf(trfCode : string) {
${this.getTrfApiUrl()}${trfCode}
let url =;
Could not delete Trf Code ${trfCode}
return this.http.delete(url).pipe(
map((apiResponse) => {
return this.apiResponseHandler.handleApiResponse(apiResponse);
}),
catchError(error =>{
this.loggerService.error(, error);
Deletion of Trf ${trfCode} failed
throw new Error();
})
);
}
*Requirement *
- await this.configurationService.deleteTrf(this.trfCode);
Until the Above line is completed below line should wait (2)
- this.afterStatusChange();
Top comments (2)
Rather await you can subscribe () and inside subscribe add your code.
this.configurationService.deleteTrf(this.trfCode).subscribe ( e =>{
this.afterStatusChange();
} )
So this subscribe code block runs only after delete request completed. Kind of await for you. For further discussion you can connect with me by email
grdtechlab@gmail.com
thanks!Thanks..