Skip to content Skip to sidebar Skip to footer

How To Make Icon Work Similar To Button In Angular 5/6?

I'm writing a code to edit names in account information and button works fine but i want edit button as an icon (pencil). Icon does not support ngIf, is there any alternative? (Ang

Solution 1:

:) adding it to the answer to make it count! Just put an icon inside the button tag like this:

<button
    mat-raised-button
    color="primary"
    (click)="onEdit()">
    <span *ngIf="!edit">Edit</span>
    <span *ngIf="edit" > Put your icon here </span> 
</button>

Solution 2:


Post a Comment for "How To Make Icon Work Similar To Button In Angular 5/6?"