ViewChild: ViewChildFactory

export ViewChild : ViewChildFactory

exported from angular2/core defined in angular2/src/core/metadata.ts (line 1147)

Configures a view query.

View queries are set before the ngAfterViewInit callback is called.

Example

@Component({
  selector: 'someDir',
  templateUrl: 'someTemplate',
  directives: [ItemDirective]
})
class SomeDir {
  @ViewChild(ItemDirective) viewChild:ItemDirective;

  ngAfterViewInit() {
    // viewChild is set
  }
}