I am new to Angular and I've been able to muddle my way through most things. I've been researching this for some time and cannot determine how to set the focus to a new FormControl created in a FormArray. Below is the relevant html code and the addRoom function. I want to set the focus to the new control in the addRoom function.
<div><span>Workspaces/Rooms</span><mat-icon (click)="addRoom()">add_circle_outline</mat-icon></div>
<div class="indent">
<div formArrayName="workspaces">
<div *ngFor="let item of adminForm.get('workspaces')['controls']; let j=index">
<input type="text" formControlName = "{{j}}" autofocus/><mat-icon (click)="deleteRoom(j)">delete_forever</mat-icon>
</div>
</div>
</div>
addRoom():void{
(<FormArray>this.adminForm.controls['workspaces']).insert(0, new FormControl(null));
//need code to set focus on new control
}