I'm migrating ionic 3 app to ionic 4.
In old app we have complex component what we use with navCtr.push multiple times, with different data. Because those components have related details, we can really go deep on the nav stack. So we have the same compontent into the nav stack multiple times.
In the new ionic 4 I have one tabs child route for this.
But when I'm navigating into the same page with different url params the animation not working.
Is it possible to animate even if we navigating forward to the same page?
Another possibe bug, when I'm on the serach tab, and trying to animate forward to the /tabs/home/component ,this is also the same component what I mentioned before, the animation is not working.
It's just displaying the correct tabs/home/childcompoennet but no animation.
If I create child component to the search tab with the same component than the animation is working.
Is this the correct way to create multipliple router endpoints under several tabs just to be abble to navigate forward with animation?
I really need to find soultion for this, otherwise we cannot migrate our application.
Thanks for the help.
`Ionic:
ionic (Ionic CLI) : 4.10.1
Ionic Framework : @ionic/angular 4.4.0
@angular-devkit/build-angular : 0.13.9
@angular-devkit/schematics : 7.3.9
@angular/cli : 7.3.9
@ionic/angular-toolkit : 1.5.1
System:
NodeJS : v10.15.1 (C:\Program Files\nodejs\node.exe)
npm : 6.4.1
OS : Windows 10
`
By default, the router ignores navigation requests to the current URL. In your app-routing module, set onSameUrlNavigation: 'reload', which should look like:
RouterModule.forRoot(routes, {
onSameUrlNavigation: 'reload',
...
}),
Alternatively you could abstract the content of your page into a component, and put the component into two different pages that have routes to each other, as I don't believe the above solution will animate.
Thank you for your help.
Thank you for your help.
Hey! How You Overcome this
I didn't.
To display animation yes we can create 2 different routes, and than load the same page once into the route 1 and next time to route 2.
But thats ugly solution in our case because we can go to that route from multiple tabs.
So i need to create that 2 extra route for each tabs, to show the navigation animation properly.
And we push multiple times that component in ionic 3 its works fine with nav push, but I dont know how to do it with ionic 4.
Also we subscrabing to the ngrx store each time on that component.
And cannot subscribe on onNgDestroy and on ionViewWillLeave.
So if I visiting third time that page than the 3 subscription happens, which not good.
Currently I'm migration the rest of the app, and I going to try this later again.
I didn't.
To display animation yes we can create 2 different routes, and than load the same page once into the route 1 and next time to route 2.
But thats ugly solution in our case because we can go to that route from multiple tabs.
So i need to create that 2 extra route for each tabs, to show the navigation animation properly.
And we push multiple times that component in ionic 3 its works fine with nav push, but I dont know how to do it with ionic 4.
Also we subscrabing to the ngrx store each time on that component.
And cannot subscribe on onNgDestroy and on ionViewWillLeave.
So if I visiting third time that page than the 3 subscription happens, which not good.
Currently I'm migration the rest of the app, and I going to try this later again.
if you find solution. comment it here
I've stumbled across this issue today (using Ionic 5 and angular 9) and the solution I've found is using a custom route reuse strategy.
This is a very good example of how to implement this.
https://www.nativescript.org/blog/how-to-extend-custom-router-reuse-strategy
Thanks for the issue. When pushing the same page with different url parameters, navigation should be working. Can you please provide a repo with the code required to reproduce this issue?
Thanks for the issue! This issue is being closed due to the lack of a reply. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.
Thank you for using Ionic!
Most helpful comment
I didn't.
To display animation yes we can create 2 different routes, and than load the same page once into the route 1 and next time to route 2.
But thats ugly solution in our case because we can go to that route from multiple tabs.
So i need to create that 2 extra route for each tabs, to show the navigation animation properly.
And we push multiple times that component in ionic 3 its works fine with nav push, but I dont know how to do it with ionic 4.
Also we subscrabing to the ngrx store each time on that component.
And cannot subscribe on onNgDestroy and on ionViewWillLeave.
So if I visiting third time that page than the 3 subscription happens, which not good.
Currently I'm migration the rest of the app, and I going to try this later again.