Created
October 25, 2016 09:53
-
-
Save NetanelBasal/830b03602328b7508b72c5911a841ded 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
import { Component } from '@angular/core'; | |
import { ViewChild } from "@angular/core/src/metadata/di"; | |
@Component({ | |
selector: 'app-root', | |
templateUrl: '<input type="text" #input>' | |
}) | |
export class AppComponent { | |
@ViewChild("input") input; | |
ngAfterContentInit() { | |
this.input.nativeElement.focus(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment