Created
October 22, 2018 17:15
-
-
Save Mattnmoore/2f325d7f044d727c8e54fd57103823db to your computer and use it in GitHub Desktop.
Angular Component Focus
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <ng-select #websiteSelect | |
| [items]="selectWebsites$ | async" | |
| formControlName="website" | |
| placeholder="Select a website" | |
| bindLabel="name" | |
| labelForId="website"> | |
| </ng-select> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @ViewChild('websiteSelect') websiteSelect; | |
| public toggleForm() { | |
| setTimeout(() => { | |
| this.mySelect.focus(); | |
| }); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I think
this.mySelectshould bethis.websiteSelect