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:

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

Solution 2:

As Uma pointed out, you can just put mat-icon inside the button.

Please see code example below: https://stackblitz.com/edit/mat-button-icon-example

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