I am developing a component in Angular2 (Beta 8). The component has a textbox and a dropdown. I would like to set the focus in textbox as soon as component is loaded or on change event of dropdown. How would I achieve this in angular2. Following is Html for the component.
Using simple autofocus
HTML5 attribute works for 'on load' scenario
<input autofocus placeholder="enter text" [(ngModel)]="test">
or
<button autofocus (click)="submit()">Submit</button>