Multiple values of NavParams does not work with dynamic links
See original GitHub issueIonic version: (check one with “x”) [ ] 1.x [ ] 2.x [x] 3.x
I’m submitting a … (check one with “x”) [x] bug report [ ] feature request [ ] support request => Please do not submit support requests here, use one of these channels: https://forum.ionicframework.com/ or http://ionicworldwide.herokuapp.com/
Current behavior:
If i use dynamic link in deep link support,
@IonicPage({
name: 'detail-page',
segment: 'detail/:id'
})
when i put 2 values id
and name
in param value
pushPage(detailInfo) {
// Push an `id` to the `'detail-page'`
this.navCtrl.push('detail-page', {
'id': detailInfo.id,
'name': 'Example'
})
}
then i can only get id
value, but value of name
is undefined
export class MyPage{
constructor(public params: NavParams){
this.params.get('id');
this.params.get('name'); // name is undefined
}
}
Expected behavior:
It should return value for name
attribute.
export class MyPage{
constructor(public params: NavParams){
this.params.get('id');
this.params.get('name'); // name is should be `Example`
}
}
Steps to reproduce:
Related code:
insert any relevant code here
Other information:
Ionic info: (run ionic info
from a terminal/cmd prompt and paste output below):
insert the output from ionic info here
Issue Analytics
- State:
- Created 6 years ago
- Reactions:2
- Comments:9 (2 by maintainers)
Top Results From Across the Web
Multiple values of NavParams does not work with dynamic links
Expected behavior: It should return value for name attribute. export class MyPage{ constructor(public params: NavParams){ this.params.get('id'); ...
Read more >how to add a dynamic button using navparams in ionic 2
I am building an app in Ionic 2, I am using navparams tu grab the button pressed when pushing another page. In this...
Read more >Ionic 4 Tab to page then back to Tab did not trigger ...
I have an small application where user can edit their account and after edit user route back to my account page. Situation: My...
Read more >Pass data between destinations - Android Developers
Destination-level arguments and default values are used by all actions that navigate to the destination. If needed, you can override the default ...
Read more >How to Pass Data with Angular Router in Ionic [v4]
Now we can get into the three different solutions we got for our problem. 1. Using Query Params (bad). The first option is...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
If the name param is in segment like ‘detail/:id/:name’, then url ‘/#/detail/12’ won’t work to get the right detail page.
How can ‘name’ be an optional param? Like @patrickmcd mentioned? @jgw96
Hello
is there any way to refresh current page (Ctrl +F5 or copy url and open url in new tab) with all params in ionic 3 ?