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? (Angular 5/6) My code is as follows:
<div>
<mat-form-field class="example-full-width" *ngIf="edit">
<input matInput placeholder="Enter name . [(ngModel)]="name">
</mat-form-field>
<span *ngIf="!edit">Name : {{name}}</span>
</div>
<div class="example-button-row">
<button mat-raised-button color="primary" *ngIf="!edit"
(click)="onEdit()">Edit</button>
<button *ngIf="edit" mat-raised-button color="primary"
(click)="onEdit()">Submit</button>
</div>
Code Output: