I have a form in my Angular app where users can enter in multiples of the same field values using an add button.
<md-content layout-padding="">
<div>
<form name="userForm">
<div layout="row" ng-repeat="person in persons">
<md-input-container flex>
<label>First name</label>
<input ng-model="person.firstName">
</md-input-container>
<md-input-container flex>
<label>Last Name</label>
<input ng-model="person.lastName">
</md-input-container>
</div>
<md-button class="md-raised" ng-click="addAnother()">Add Another</md-button>
</form>
</div>
</md-content>
Working Codepen
So already a couple of inputs are populated, clicking the button adds a new object in order for a new set of inputs to appear.
What I would like is for the first input on the newly added row to receive focus so the user can start entering in right away.
Is there some way to set the tabIndex programatically?