question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[v4] Router not navigating in lazyloaded children

See original GitHub issue

Bug Report

Ionic Info

cli packages: (/usr/local/lib/node_modules)

   @ionic/cli-utils  : 2.0.0-rc.6
   ionic (Ionic CLI) : 4.0.0-rc.6

global packages:

   cordova (Cordova CLI) : 8.0.0

local packages:

   @angular-devkit/core       : 0.6.0
   @angular-devkit/schematics : 0.6.0
   @angular/cli               : 6.0.0
   @ionic/schematics-angular  : 1.0.0-rc.5
   Cordova Platforms          : android 7.0.0
   Ionic Framework            : @ionic/angular 4.0.0-alpha.3

System:

   ios-deploy : 1.9.2
   NodeJS     : v8.11.1
   npm        : 6.0.0
   OS         : macOS High Sierra
   Xcode      : Xcode 9.3.1 Build version 9E501

Environment Variables:

   ANDROID_HOME : not set

Router not navigating in lazyloaded children I’ve got the router navigation doing the following

Remove following line in the AppModule. { provide: RouteReuseStrategy, useClass: IonicRouteStrategy }

That got the router working however I’m running into issues when navigating into lazyloaded child pages where if I back out of them using the back button then the routerlinks no longer do anything, I’ve subscribed to the nav events and nothing happens other than the usual “ionRouterOutletActivated” that gets spit out in the console.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:6
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
mschwarzmuellercommented, Aug 10, 2018

I get that same issue. Using imperative routing via navigateByUrl and passing in the full URL seems to be a workaround. Not a great one though as relative routing is basically not working at the moment.

As posted by OP, first navigation works but after using the <ion-back-button>, the link essentially is dead.

0reactions
ionitron-bot[bot]commented, Jan 2, 2019

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. 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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Children of Lazy Loaded Modules routes don't work
What you're doing by clicking the "Order Child" button is navigating to the child route /orders/child : for that to work you need...
Read more >
[v4] Router not navigating in lazyloaded children · Issue #14478
I get that same issue. Using imperative routing via navigateByUrl and passing in the full URL seems to be a workaround. Not a...
Read more >
Route - Angular
The following route uses the redirectTo property to ignore a segment of a given URL when looking for a child path. When navigating...
Read more >
Angular Child Routes and Relative Navigation Example
This page will walk through Angular child routes and relative navigation example. A route can have one or more than one child routes....
Read more >
How To Use Lazy Loading Routes in Angular | DigitalOcean
Learn how to enable feature modules to be lazy-loaded in Angular, ... Node v16.4.0, npm v7.19.0, @angular/core v12.1.0, and @angular/router ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found