How to redirect from guard in a module federated angular application

190 Views Asked by At

I have a module federated angular application where I have a route-guard that redirects to another route. When loaded as standalone application redirection works perfectly, problem occurs when it is inside a shell application where I get an error saying the router cannot find any such routes.

Following are my router configuration

routing.module.ts
routes exposed from my applicatoin

redirecting.guard.ts
redirection route guard

this is the error i get in the console from shell-application
enter image description here

I tried other ways of navigation like navigate(), navigateByUrl() which did not work.
The error occurs only when redirected from route-guard. I'm unsure if this is a limitation or a issue with my implementation

1

There are 1 best solutions below

1
Naren Murali On

Could you try changing it to

this._router.navigate(['/nested/video']);

Since you are at the root level, we can try absolute routing to make it work?