My Angular Code
getStatus(transferDTO){
this.queryResourceService.getInventoryStatusIdByStatusNameAndStatusTypeUsingGET(transferDTO).subscribe(
this.save()
);
/*
Remaining code here
*/
this.save()
}
function save() {
}
Now I don't want to call this.save() twice, I want it to be invoked only after the callback is executed as well as remaining code in the method is executed... Of course, I can get around this problem as follows
getStatus(transferDTO){
/*
Remaining code here
*/
this.queryResourceService.getInventoryStatusIdByStatusNameAndStatusTypeUsingGET(transferDTO).subscribe(this.save());
}
save(){
}
but I don't want to delay the callback method. So how can I solve this problem?