Hi!
I’m having issues making the navigation work in the iOS emulator. This is a simplified code snippet:
import {Component} from '@angular/core';
import {NavController, NavParams} from 'ionic-angular';
@Component({
template: `
<pre>{{ state | json }}</pre>
<ion-select (ionChange)="selectState($event)">
<ion-option>State 1</ion-option>
<ion-option>State 2</ion-option>
</ion-select>
`
})
export class StatePage {
private state;
constructor(private nav: NavController) {}
selectState(state) {
this.state = state;
console.log("before navigation");
this.nav.push(BaseCodePage, { state });
console.log("after navigation");
}
}
@Component({
templateUrl: 'build/pages/registration/base-code/base-code.html'
})
export class BaseCodePage {
constructor(
private nav: NavController,
params: NavParams
) {
console.log("initializing BaseCodePage, received", params.get('state'));
}
}
After selecting State 1
from the interface, and trigerring selectState
, all the messages show up: before navigation
, initializing BaseCodePage, received State 1
and after navigation
, meaning that the next component was instantiated. There is no error message, or any output after this. The selected state also gets rendered in the screen, through the <pre>{{ state | json }}</pre>
. However, the application freezes at this point, I can’t click on the select anymore, and the next component doesn’t get rendered.
I’ve tested this in the web version as well as the Android version, and both are working fine. Unfortunately I can’t test it in an iPhone since I don’t own a Mac and I’m doing the debugging remotely for a client, so for now I can only claim that it doesn’t work in the iOS emulator.
Did anyone have this problem? Any tips for further debugging since there’s no error messages?
Thanks!