Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 71531

Changing variables inside platform.ready?

$
0
0

@nanexcool wrote:

Hey guys, I have this simple page (Beta 4):

constructor(platform) {
  this.title = 'INITIAL';
  platform.ready().then(() => {
    this.title = 'INSIDE PLATFORM;
  });
}

and in the HTML:

<ion-content>
{{title}}
</ion-content>

When I run this, title stays as INITIAL and never changes to INSIDE PLATFORM... unless I do something else outside platform.ready that triggers changes (like tapping a button or something).

Is this something of Angular 2 that I'm not understanding?

If I import ChangeDetectorRef from angular2/core and do cdr.detectChanges() inside platform.ready() then it works, but this feels weird.

Posts: 4

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 71531

Trending Articles