Pass parameters between screens [ionic2 / angular2]

0

Good morning everyone! I would like to know how I could be passing a parameter (id) between the screens, I tried the NavParams, but I could not do what I wanted. I would like to put the ID on the ion-item and when I clicked it it would send the id to another screen.

Thank you in advance!

    
asked by anonymous 28.08.2017 / 14:36

1 answer

0

Good afternoon Jean.

Just pick up the same navParans.

To pass the id do the following:

this.navCtrl.push(TestePage, {id: '1'});

There in TestePage, you get with:

let id_objeto = this.navParans.get(id);

IONIC Documentation for NavParams

    
01.02.2018 / 15:26