title: conditionally show and hide button using angular 6
body: <p>Actually i am trying to disable the button when the task is running. Once the task finished loading i want to activate the button. Means paralally the sync icon spins when the task status is in 'In_progress' once the status changes to 'Completed' the spinner should be hidden and the button 'AutoCode Sync' should be activated. So how to achieve that one. For that i have written the below code:</p>
  
  <pre><code>&lt;section *ngFor="let task of tasksRes"&gt;
      &lt;nav&gt;
          &lt;span class="text-warning" *ngIf="task?.status == 'In_progress'"&gt;&lt;i class="fa fa-spinner fa-spin"&gt;&lt;/i&gt;&lt;/span&gt; 
      &lt;/nav&gt;
  
      &lt;div class="pull-right"&gt;
          &lt;button mat-raised-button color="primary" (click)="open();" class="btn-w-md"&gt;
          AutoCode Sync
          &lt;/button&gt;
      &lt;/div&gt;
  &lt;/section&gt;
  </code></pre>
  
  <p>Can anyone please help me in this to achieve?
  Thanks.</p>