ERROR -, Ionic V3, Angular 2 - ScrollToBottom();

Hi all,
I need your help fixing my scrollToBottom();

I’ve recently followed Simon’s tutorial:

His tutorial teaches us how to make a real-time chat app using, Ionic 2+ and Angular 2.
I followed the tutorial completely and everything is perfect; but I tried adding a ViewChild for (‘content’);
that way I’ll be able to automatically scroll down (it works) but my console.log(); and Ionic keep returning the following errors.

Ionic Error:
Runtime Error Cannot read property 'scrollToBottom' of null

Ionic Serve -lc Error:
[18:30:53] console.error: ERROR [object Object]

Implimentation of scrollToBottom();

scrollToBottom() fix source:


<ion-content #content>
<--- Source requests #content be added to ion-content --->

I have these references in my Chatmessages.ts:

import { Component, ViewChild } from '@angular/core';

I’ve tried doing it in the Component like this:

  selector: 'page-chatmessages',
  templateUrl: 'chatmessages.html',
      queries: {
	    content: new ViewChild('content')

That didn’t work so I’m trying this:
@ViewChild(Content) content: Content;

That doesn’t work either…

  //scrolls to bottom whenever the page has loaded
  ionViewDidEnter() : void{
    //if(this.content._scroll) this.content.scrollToBottom(0);
    this.content.scrollToBottom(300);//300ms animation speed

  scrollToBottom() {

In my getMessages(); and sendMessage(); I scrollToBottom() like this:



Problem - from resources:
import { Content } from 'ionic-angular/index';

import { Content } from 'ionic-angular';