When user clicks on button, addElement method will push object to array of elements and new input field will be created. Is it possible to focus on the newly created element? Inputs don't have distinctive IDs.
Template:
<div *ngFor="let foo of elements">
<input class="input" value="{{ foo.value }}" />
</div>
<button (click)="addElement()"></button>
Method:
public addElement() {
this.elements.push({ value: 'new' });
}
I'm using Angular 9 in this application.