In my current project, I am facing a challenge where I need to disable a button while a task is running and then activate it once the task is complete. Specifically, I want a syncing icon to spin when the task status is 'In_progress' and then hide the spinner and enable the 'AutoCode Sync' button when the status changes to 'Completed'. I have tried implementing this functionality using the following code:
<section *ngFor="let task of tasksRes">
<nav>
<span class="text-warning" *ngIf="task?.status == 'In_progress'"><i class="fa fa-spinner fa-spin"></i></span>
</nav>
<div class="pull-right">
<button mat-raised-button color="primary" (click)="open();" class="btn-w-md">
AutoCode Sync
</button>
</div>
</section>
I would appreciate any help or suggestions on how to successfully achieve this functionality. Thank you.