renderer2 focus code example
Example: focus button using renderer2
<form [formGroup]="form">
<mat-form-field class="full-width">
<input matInput placeholder="Focused Input">
<button id="myInput" formControlName="myInput">TEXT</button>
</mat-form-field>
<br>
<button mat-raised-button color="primary" (click)="focusMyInput()">Focus</button>
</form>