Angular 2 @ViewChild not working. Cannot Read Property “title” of Undefined
问题 I am unable to access the property of component even after importing with @ViewChild. Below is the code. header.monitor.component.ts import { AdminComponent } from 'admin/admin.component'; import { Component } from '@angular/core'; import { ViewChild, AfterViewInit } from '@angular/core'; @Component({ selector: 'monitor-header', templateUrl: './header.monitor.component.html', styleUrls: ['./header.monitor.component.css'] }) export class HeaderMonitorComponent implements AfterViewInit {