Pass variable through MyApp to pages

I’m using today Ionic 2 for the first time and I’m new to A2 ( I always developed with 1.x ).

I’m trying to pass a variable “countChat” from the class MyApp to a page, but without success.


class MyApp {
  static get parameters() {
    return [[IonicApp], [Platform], [MenuController]];

  constructor(app, platform, menu) {
    // set up our app

    // set our app's pages

    // make HelloIonicPage the root (or first) page
    this.countChat = 3;


<div>{{ countChat }}</div>

This is the code, but in the page nothing is showed.


is better you put all the Chat vars and functions in a provider, take a look in the conferece app how its works.

Thanks. Now I can see the OOP logic of TypeScript :slight_smile: