How can I autofocus input element? Similar to this question, but not with AngularDart. Something like this:
You could assign the input element a template reference variable #myInput:
Let your component implement AfterViewInit, grab the reference of the input element with the ViewChild annotation and focus your element in the ngAfterViewInit hook:
export class MyComponent implements AfterViewInit {
@ViewChild("myInput") private _inputElement: ElementRef;
[...]
ngAfterViewInit(): void {
this._inputElement.nativeElement.focus();
}
}