I am faced with an interesting scenario where I have a button that updates a counter and another button that navigates to another page:
<ion-content>
<button [navPush]="aboutPage">test</button>
<p>
{{Counter}}
</p>
<button (click)="clicking()">+</button>
<ion-content>
Here is the corresponding code:
import { Component } from '@angular/core';
import { NavController } from 'ionic-angular';
import { AboutPage } from '../about/about';
@Component({
templateUrl: 'build/pages/home/home.html'
})
export class HomePage {
public aboutPage = AboutPage;
public Counter: number = 0;
constructor(public navCtrl: NavController) {
}
clicking(){
this.Counter++;
}
}
1. When clicking the Back button from the About Page (this button is there by default), the + button increments the counter properly, but the displayed text on the view does not update. It's a simple test and I'm struggling to identify the issue.
- When I click the test button, I have to click it twice for it to work. Is this an issue specific to Ionic 2?
Appreciate any help or insights, Gabi S.