Focus on input field by default

ngAfterViewInit() {
        // focus input field after the view is initialized
        if (this.titleInput && this.titleInput.nativeElement) {
          this.titleInput.nativeElement.focus();
        }
    }
Was this page helpful?