3gwebtrain
3gwebtrain

Reputation: 15303

How to transition with URL query param in ember routing?

when my page loads, I am just typing the following:

credit-card/credit-cardno?country=SG

now I am getting country as "SG". fine. But how can I make transition to next page with above details?

I tried like this:

this.transitionTo('HK.cs2i.cs2i.purchase.purchaseReview?country=SG');

But getting error. do i require to update my routerjs or my transitionTo is wrong?

once the page transition done, I would like to see my URL as :

HK/cs2i/cs2i/purchase/purchaseReview?country=SG

Thanks in advance

Upvotes: 1

Views: 1256

Answers (1)

ykaragol
ykaragol

Reputation: 6221

Use this:

this.transitionTo('HK.cs2i.cs2i.purchase.purchaseReview',{queryParams:{country:SG}});

Also you can try this:

this.transitionTo('/HK/cs2i/cs2i/purchase/purchaseReview?country=SG');

Source from Ember API

Upvotes: 1

Related Questions