I have the below partial HTML in my Material Table Angular application.
//HTML
<button mat-icon-button class="mat-18" (click)="updateStatus(element.id)"
[disabled]="validateToWork(element.reachedTime)">
<mat-icon>edit</mat-icon>
</button>
//Typescript
validateToWork(reachedTime:any):boolean{
if(reachedTime&& new Date(this.datePipe.transform(reachedTime, DATE_WITH_TIME)) < new Date())
return true;
else
return false;
}
The above code works fine and the edit button is disabled. But what i observed is when i have a console.log(reachedTime) in the typescript like,
console.log(reachedTime)
if(reachedTime&& new Date(this.datePipe.transform(reachedTime, DATE_WITH_TIME)) < new Date())
I could see the event is triggered on every mouseover i do on the table. Its weird for me and not sure. How can i stop that?
Below is the console log i have
Any help ?
