I’m using the Ionic 2 Alert component by the book, and am receiving an error:
TypeError: Attempted to assign to a readonly property. in [d.buttons in AlertCmp@0:1548]
This is pretty annoying since my code seems to be almost exactly dupicated from the examples (simplified for brevity):
export class myPage{
static get parameters(){
return [[IonicApp]];
}
constructor(app){
this.app = app;
this._eventHandler();
}
_eventHandler(){
let nav = this.app.getComponent('nav');
let a = Alert.create({
title: "Cool alert.",
buttons: [
{
text: "Ok",
handler: () => {}
}
]
});
nav.present(a);
}
}
This particular version of the code is a more explicit version - i.e. uses full button object definition, etc. I’ve tried many permutations including passing the nav in as a dependency and creating the alert in various ways.
I’m not entirely ruling out that the problem could be elsewhere, but I’m positive that it’s linked with the nav.present() call because when I comment that out everything else fires off without a problem.
Thoughts?