$ionicScrollDelegate.scrollBottom(); in Ionic 2 - how to?

Hi guys,

im currently building an Ionic 2 Chat app and want to scroll bottom when my http.get adds a new message to messages array. In ionic 1 there was the $ionicScrollDelegate.scrollBottom(); but how can i do this in Ionic 2.

I got this code:

<ion-content class="no-scroll" no-bounce>
  <ion-grid id="headermenu" padding>
    <ion-row>
      <ion-col width-25>
        <button ion-button (tap)="goBack()">
          <ion-icon name="arrow-dropleft-circle"></ion-icon>
        </button>
      </ion-col>
      <ion-col width-50 text-center><img src="img/timeout-logo-white.png"/></ion-col>
      <ion-col width-25 text-right>
      </ion-col>
    </ion-row>
  </ion-grid>

  <ion-scroll scrollY="true" class="full-height">
    <ion-refresher (ionRefresh)="doRefresh($event)">
      <ion-refresher-content
        pullingIcon="arrow-dropdown"
        refreshingSpinner="circles">
      </ion-refresher-content>
    </ion-refresher>
    <ion-list id="item-list">
      <ion-item *ngFor="let notification of notifications" class="notification">
        {{notification.code}}
      </ion-item>
    </ion-list>
  </ion-scroll>
</ion-content>

and i want to scroll to bottom of ion-list

Another questions - has somebody already made an chat application in ionic 2 typescript 2 + angular 2 - can you help me with this?

Greetings Daniel

I know it’s late but I just figured out the solution. If it’s of use for anyone.

1 Like