Ion-content scroll to top in Ionic 2


#1

How to scroll to top of ion-content?


#2

I found the solution but couldn’t find how to delete the post. So, I’m pasting solution here

import {ViewChild} from '@angular/core';
import {Content} from 'ionic-angular';

@Page({...}
export class MyPage{
  @ViewChild(Content) content: Content;

  scrollToTop() {
    this.content.scrollToTop();
  }
}