Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 70769

Using Router -> getCurrentNavigation () // My variable is always the same

$
0
0

@Aexils wrote:

Hello, I do not know how to ask my question but I use

this.router.navigateByUrl('tabs/list', {state: {country: this.country}});

I get my ‘country’ variable in my ‘list’ page very well, except that when I restart a query with another value in my variable.
When I get my variable in the ‘list’ page, like that :

this.stateUrl = this.router.getCurrentNavigation().extras.state.country;

This.stateUrl always returns me the value of my first variable …
What approaches are possible?
Reload my function? How?

Another way to get my variable?

Thanks !

Edit :
To put in context, I have a search bar, the user writes for example: “Paris”, then validates his search, he finds himself on the page ‘list’ with the name of several restaurants in Paris. If the user now returns to search and writes: “fksgrfs”, and validates, he will still have the results for Paris since the variable this.country does not update :disappointed:

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 70769

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>