title: Error: Uncaught (in promise): TypeError: _this.searchElementRef is undefined
body: <p>I have used google place api following <a href="http://www.17educations.com/angularjs-2/google-map-api-angular-2-typescript/" rel="nofollow noreferrer">this</a></p>
  
  <p>but i am getting this error below</p>
  
  <pre><code>ERROR Error: Uncaught (in promise): TypeError: Cannot read property 'nativeElement' of undefined
  </code></pre>
  
  <p>-html file</p>
  
  <pre><code> &lt;div class="form-group" [formGroup]="myGroup"&gt;
      &lt;input placeholder="search for location" autocorrect="off" autocapitalize="off" spellcheck="off" type="text" class="form-control" #search formControlName="searchControl"&gt;
   &lt;/div&gt;
  </code></pre>
  
  <p>-typescript file:</p>
  
  <pre><code>  @ViewChild("search") searchElementRef: ElementRef;
  
    ngAfterViewInit() {console.log(this.searchElementRef)}
  </code></pre>
  
  <p>I want to use this.searchElementRef.nativeElement.</p>