Hi,
I have a button in my app that calls the method submitRequest() defined below:
<button block (click)="submitRequest()">
Submit Request
</button>
submitRequest() {
console.log('request submitted');
var request = this.formAnswers
request['category'] = this.categoryName
this.nav.setRoot(Requests);
}
This works absolutely fine in the browser. When testing on ios device the first time I click the button I get an exception in in the XCode terminal:
.
.
2016-05-05 22:57:54.937 Projya[4724:2872858] request submitted
2016-05-05 22:57:54.938 Projya[4724:2872858] ngOnDestroy
2016-05-05 22:57:54.938 Projya[4724:2872858] EXCEPTION: Error during evaluation of "click"
2016-05-05 22:57:54.938 Projya[4724:2872858] ERROR: EXCEPTION: Error during evaluation of "click"
2016-05-05 22:57:54.938 Projya[4724:2872858] ERROR: ORIGINAL EXCEPTION: TypeError: null is not an object (evaluating '_this._el.removeEventListener')
2016-05-05 22:57:54.938 Projya[4724:2872858] ERROR: ORIGINAL STACKTRACE:
.
.
What’s really strange is that the second time I click - it works just fine.
If I change this like to this.nav.push - everything works as well but the desired behaviour is to set a new root page.
I am using ionic2 beta 6.
Cheers.