title: Go to Top of page on button click in Angular 2
body: <p><strong>Want to go to top of the page on button click , Currently I using following code which is not working :</strong> </p>
  
  <p><strong>HTML:</strong></p>
  
  <pre><code>&lt;button md-raised-button class="md-raised md-primary" (click)="onEdit()"&gt;Edit&lt;/button&gt;
  </code></pre>
  
  <p><strong>Function:</strong></p>
  
  <pre><code>onEdit(){
      window.scrollTo(0,0);
    }
  </code></pre>