Skip to content
masterclass Buddy

Angular · Decorator

@ViewChild

@ViewChild finds the first matching item in a component's view and assigns it to a class property. It supports components, directives, template references, providers, string tokens, and templates.

Last updated

Syntax

@ViewChild(selector, opts?)

In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.

Subscribe
  • ViewChildren
  • ElementRef
  • TemplateRef
  • ViewContainerRef
  • Injector

Source: ViewChild • Angular. Checked 2026-11-03.