DEV Community

Unable to await Delete Method.

ID-GO on February 08, 2022

await this.configurationService.deleteTrf(this.trfCode); this.afterStatusChange(); deleteTrf(trfCode : string) { let url =${this.getTrf...
Collapse
 
gaurangdhorda profile image
GaurangDhorda

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!

Collapse
 
idgo profile image
ID-GO

Thanks..