I am using Bootstrap 4 on Angular 6, and I have a delete button that should change its icon when the mouse enters the button. However, I have tried several of these ng functions (ngMouseOver, ngMouseUp, etc.) and none of them have worked.
Here is the code:
component.html
<button type="delete" class="btn" (click)="delTr(tr)" ng-
mouseenter="buttonHover()"><i class="{{ButtonIcon}}"></i></button>
component.ts
ButtonIcon: String = "far fa-trash-alt";
...
buttonHover()
{
console.log("Mouse Enter works.")
this.ButtonIcon = "fas fa-trash-alt"
}
The console log does not output anything when the program runs, so the method buttonHover()
is not being activated.
Also, the button icon "far fa-trash-alt" works as intended. Any help would be appreciated.