@ViewChild('firstNameInput') nameInputRef: ElementRef; code example Example: angular viewchild second parameter @ViewChild(ChildDirective, {static: false}) Component