@Stickse wrote:
Hi to everyone,
i'm trying to send a parameter from a first component to a second component in this way (only relevant code of first component, if i trythis.navCtrl.setRootetc i get the same effect):this.navCtrl.push(SecondComponent,{infodata: "val" });In my second component (only relevant code):
datarec; constructor(public navCtrl: NavController, public navParams: NavParams) { this.datarec=this.navParams.get('infodata'); console.log(this.datarec); }in my console i can see:
val
undefinedSo this code is called two times and the problem is that i can't use my parameter because it's always undefined. My questions:
Why it's called two times? What can make reload the page of the second component?
thanks who will try to help.
Posts: 4
Participants: 2