Using angular2 and angular2-material with following pattern:
<form #userForm="ngForm" style="background-color: rgba(209,216,239,0.29)" layout-padding="20px">
<div layout="row" layout-margin>
<md-input-container flex>
<input md-input
#eAccountName
#cAccountName="ngModel"
type="text"
placeholder="Account Name"
[(ngModel)]="accountName"
name="accountname"
maxlength="50"
[disabled]="!isEditable"
required>
</md-input-container>
</div>
</form>
How do I programmatically focus this (or any other) input element? If possible, I'd also like to select the contents of the text field once its focused.
Thanks.