Setting the page title


#1

I’m not using <ion-header> or <ion-title> in my app, so I need to set my page title programmatically in my page. I’ve found this solution:

Which suggests the following:

import { App } from "ionic-angular";

export class MyPage {

    title = "Navbar Title";

    constructor(private _app: App) {
    }

    ionViewDidEnter() {
        this._app.setTitle(this.title + " - App Name");
    }
}

but this isn’t working, and my page title remains Ionic App (which is what is currently in <title> tag in index.html)

Is there any reason setTitle wouldn’t be working?

EDIT Simply setting the document.title works:

ionViewDidEnter() {
  document.title = "Test";
}