angular icon indicating copy to clipboard operation
angular copied to clipboard

Navigation and nested page-router-outlet with lazy loaded children

Open fpaaske opened this issue 3 years ago • 4 comments

Environment Provide version numbers for the following components (information can be retrieved by running tns info in your project folder or by inspecting the package.json of the project):

  • CLI: 8.1.5
  • Cross-platform modules: 8.1.5
  • Android Runtime: 8.1.0
  • iOS Runtime: 8.1.1
  • Plugin(s): "@nativescript-community/ui-material-bottom-navigation": "~6.2.13"
  • NativeScript-Angular: 13.0.2
  • Angular: 13.1.1

Describe the bug

Navigation for a page-router-outlet is not working anymore after navigating back from details view.

I have a navigation setup with nested page-router-outlets, much like this example, except the children (player details and team details) are also lazy loaded modules with their own routes.

After starting the app, and the tabs are loaded with their lazy loaded module, I can navigate to the details view and back. However, when I try to navigate to the details view again, there's no response. I have enabled tracing on the router, and there are no events fired when navigating back. Also no events are fired on new navigation attempts.

If I navigate to another tab, I can repeat the process. Then that will be "stuck" as well.

To Reproduce Use the example from the link above and lazy load the details components.

Expected behavior Navigation should keep working regardless of lazy loaded children.

Sample project

Additional context

This was working in @nativescript/angular 13.0.1, but then with issues like #49 and #53

fpaaske avatar Feb 15 '22 08:02 fpaaske

@nativescript/[email protected] breaks the back navigation for me as well, even without nested page-router-outlets.

@edusperoni @NathanWalker Let me know if you need a sample project for reproduction.

jessorlisa avatar Feb 16 '22 09:02 jessorlisa

I can also confirm that it broke the navigation for me to on 13.0.2, also without nested router-outlets, downgrading to @13.0.1 fixed the issue for me.

13dante04 avatar Feb 17 '22 09:02 13dante04

Please provide an example project of the behavior so I can take a look. Unfortunately I haven't run into this issue on any of my apps.

edusperoni avatar Feb 17 '22 16:02 edusperoni

@edusperoni I assume @jcassidyav's sample was sufficient?

jessorlisa avatar Feb 18 '22 08:02 jessorlisa