I have one matInput field and a mat-icon(edit icon). When I click on the edit icon I need to perform the following operations
enable the input text box,
sets focus to it,
and auto-selects all the text in that.
Tried '$event.target.select()'. But it is not working. How can I do that? Thanks in advance.
.html file
<mat-form-field class="input-style">
<input matInput[(ngModel)]="name"(click)="$event.target.select()">
{{value}}
</mat-form-field>
<button mat-icon-button color="primary">
<mat-icon (click)="$event.target.select()">edit</mat-icon>
</button>
.ts file
export class Sample {
public value:string ="sample";
}