my.component.html
<button (click)="refresh()">Refresh</button>
my.component.ts
refresh() {
let self = this;
self.isRefresh = true; //1st time
self.getfun().then(() => {
self.isRefresh = false;
});
}
I am seeking a professional way to ensure that self.isRefresh = false; is only executed after self.getfun(); has completed its execution entirely.
Please advise on the best practice for handling this scenario in an Angular asynchronous environment without modifying getfun().