Pass parameters between screens [ionic2 / angular2]

Asked

Viewed 252 times

0

How to pass a parameter (id) between screens?

I tried Navparams, but I couldn’t do what I wanted. I would like to place the ID on the ion-item and when I click it send the id to another screen.

1 answer

0

Just pick up by the navParams.

To pass the id do the following:

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

Down at Testepage, you get with:

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

IONIC documentation for Navparams

  • Grateful lazyFox, for the edition! !

Browser other questions tagged

You are not signed in. Login or sign up in order to post.