title: Scroll to top of the page with click in angular 8
body: <p>I have angular 8 application.</p>
  
  <p>And I have navigation buttons for next and previous. But so I want to archieve that you will be navigate to top of the page when next is triggerd.</p>
  
  <p>So I have this:</p>
  
  <pre><code> &lt;h4 id="heading"  #goUp class="echeq-title"&gt;{{ currentEcheqPage.title }}&lt;/h4&gt;
  
  </code></pre>
  
  <p>and ts file:</p>
  
  <pre><code>export class EcheqPageComponent implements OnInit, AfterViewInit {
  
    @Input() currentEcheqPage: EcheqPage;
    @Input() currentEcheqPager: EcheqPager;
    @ViewChild('goUp', {static: false}) contentPage: ElementRef;
  
    // We use template variables to query the components
    @ViewChildren('echeqElement') elementComponents: QueryList&lt;EcheqElementComponent&gt;;
  
    EcheqElement = EcheqElement;
    elementsChanged = true;
    container: HTMLElement;
  
    constructor( private echeqService: EcheqService ) { }
  
    ngOnInit() {
      // document.getElementById ('heading').scrollIntoView();
    }
  
    ngAfterViewInit(): void { 
      this.showUp();
  
    }
  }
  
  private showUp(): void {
      this.contentPage.nativeElement.scrollTo( 0, 0 );
    }
  
  
  
  </code></pre>
  
  <p>But I don't get error. But also it is not navigating to top of page. IN this case the h4 heading.</p>
  
  <p>So what I have to change?</p>
  
  <p>Thank you.</p>