title: Angular 5 Cannot find name ngAfterViewChecked
body: <p>In Angular 5 project, I want to make a scroll to the top of the page which will be called on page load. Below is my code in update-product.component.ts :</p>
  
  <pre><code>export class UpdateProductComponent implements OnInit, ngAfterViewChecked 
  {
      productUpdateForm: FormGroup;
      dataInvalid = false;
      formErrors = []; 
  }
  
  ngAfterViewChecked() {
      window.scrollTo(0, 0);
  }
  </code></pre>
  
  <p>However, as mentioned below, I received such an error message when I run the command: <code>ng serve</code> from terminal.</p>
  
  <blockquote>
    <p>ERROR in src/app/update-product/update-product.component.ts(15,56):
    error TS2304: Cannot find name 'ngAfterViewChecked'.</p>
  </blockquote>
  
  <p>But, also note, sometimes the code runs and scrolls properly. But shows the error when run <code>ng serve</code> command.</p>