Created
September 6, 2019 08:59
-
-
Save Mayankgupta688/703891c75a2d7ac5a569ddc1efe0ea76 to your computer and use it in GitHub Desktop.
This file contains 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
@Component({ | |
selector: 'accessing-template-reference', | |
template: '<div><input type="text" #someElement />' | |
}) | |
export class HeroListComponent implements OnInit { | |
@ViewChild("someElement") domReference; | |
ngAfterViewInit(): void { | |
this.domReference.nativeElement.focus(); | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment