How can I get data from url


#1

Hi every body, I am working in browser app and need to pass data via url to a page.

How can I do this?


#2

Try:

  public openPage(item: any) {
    this.navCtrl.push('VenuePage', { id: item.id });
  }

And:


...

@IonicPage({
  segment: 'venue/:id',
})

...

  constructor(public navCtrl: NavController,
              public navParams: NavParams) {

    this.itemId = navParams.get('id');
  }

...

#3

Thanks Robinyo but seems the problem is for the new version of Ionic, before, when it created a page, just made a 3 news archive, but now the cli created 4


#4

Maybe you should post your ionic info?


#5
@ionic/cli-utils  : 1.19.2
ionic (Ionic CLI) : 3.20.0

global packages:

cordova (Cordova CLI) : 7.1.0

local packages:

@ionic/app-scripts : 3.1.9
Cordova Platforms  : none
Ionic Framework    : ionic-angular 3.9.2

System:

Node : v9.8.0
npm  : 5.8.0
OS   : Windows 10

Environment Variables:

ANDROID_HOME : not set

Misc:

backend : legacy

#6

See: