Questions tagged [viewchild]

ViewChild is a decorator for Angular component variables, which allow to bind a template element.

ViewChild is a decorator for Angular component variables, which allow to bind a template element. Official Angular documentation here: https://angular.io/api/core/ViewChild.

437 questions
-2
votes
3 answers

@ViewChild returns undefined - Angular 2

I'm trying to use @ViewChild to get the DOM element that I need. I have the following component that describes my problem: import {Component, ViewChild, ElementRef, OnInit, Input} from "@angular/core"; @Component({ selector: 'some-comp', …
Zak
  • 1
  • 1
-4
votes
1 answer

@Viewchild Angular 5, 6 - ElementRef

I have referenced a control with ElementRef of Angular and for this I use this code: HTML :
1 2 3
29
30