Content not available in Component (rc.1)



I have one problem after upgrade from beta.11 to RC.0/RC.1 (I don’t know which RC break this for me.)

I can implement content.scrollToTop() when user Click on app Title.

This is me implementation:

<ion-title (click)="scrollToTop()">{{ title | translate }}</ion-title>


import { ViewChild } from '@angular/core';
import { Content } from 'ionic-angular';
export class ActivityList extends AbstractComponent {
    @ViewChild(Content) content: Content;


    scrollToTop() {
        console.log(this.content);   <---- undefined ! 

But mi content is undefined, and I don’t know why.

Is this a bug?


Anyone with this problem? :slight_smile:


Hi, did you try adding #content on your ion-title ?

That’s how I do it in my app and it’s working fine.


yes I try this, and it’s not work for me.


Hum, thats kinda weird, I tried this on my project and it works fine:

<ion-title #content class="ion-title-align" (click)="test()">Title</ion-title>

And in my class

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

    templateUrl: "testt.html",

export class TestClass{

@ViewChild(Content) content: Content;

public test() {


@tomco3131 I think you should have an ion-content tag in your html template so that @ViewChild could see it, but I see only an ion-title.