IonicPage - More than one parameter

Hello,

I found this in the documentation:

@IonicPage({
    name: 'detail-page',
    segment: 'detail/:id'
})

But how can I pass a secound Parameter and how will the URL look like?

I Need something like this.

@IonicPage({
    name: 'detail-page',
    segment: 'detail/:id:socound'
})

http://domain.de/#/detail/2/test

Any suggestion?
Thanks in advance.

can you tell us what exactly do you need to do so we can help you ?

I can try it.

At the moment I have this page Definition

@IonicPage({
   name: 'clothing_detail',
   segment: 'cdetail/:_id'
})

So I can build URLs like this:

http://weeklystyle.de/#/cdetail/12

When I translate this to a normal get URL it Looks like this.

http://weeklystyle.de/cdetail.php?id=12

No I want to put more then one parameter in the URL

Something like this

http://weeklystyle.de/cdetail.php?id=12&table_name=product

How must the ionicpage Segment look like to do something like this?

Why do you need the second part of the URL?

I want to use one page with more then one databese table.

So the id and the tablename parameter define wich data woud be shown on the page.

I would do this with a link only for search bots.

For this url:
http://localhost:8100/#/multi/20/abcd/78-89-123

…This example will print
{id: "20", descp: "abcd", freetext: "78-89-123"}

@IonicPage({
    segment: 'multi/:id/:descp/:freetext'
})
@Component({
  selector: 'page-multi-params',
  templateUrl: 'multi-params.html',
})
export class MultiParamsPage {

  constructor(public navCtrl: NavController, public navParams: NavParams) {
     console.log(navParams.data)
  }

}

ionic info:

@ionic/cli-utils  : 1.9.2
ionic (Ionic CLI) : 3.9.2

local packages:

@ionic/app-scripts : 2.1.3
Ionic Framework    : ionic-angular 3.6.0

System:

Node : v6.10.1
npm  : 5.3.0
OS   : Windows 7
5 Likes

Thank you very much.