You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Which @angular/* package(s) are the source of the bug?
router
Is this a regression?
Yes
Description
PLEASE NOTE: this explanation requires the provided code to be inspected.
Started investigating on an project were the behaviour was the following:
routing to / - correctly redirected to a
from /a navigating to /b via routerlink - correctly redirected to /b/c
from /b/c navigating to /b/d via routerlink - no action, navigation stuck - no messages in console, no debug in components' constructors or whatever, simply getting a static page with no behaviour
if instead I opened
/b - correctly redirected to /b/c
from /b/c to /b/d - navigation working as expected
putting up the stackblitz test project came out that the B component was missing Router as Provider (which is something new, never needed to add a provider -without injecting it in the constructor- and get tangible changes in the behaviour)
Then I observed the strange behaviour on stackblitz: routes cannot be accessed via absolute routing as described in the following section
Please provide a link to a minimal reproduction of the bug
Looks like a duplicate of #55831. You should not reprovide the Router in each component. This causes a new instance of the Router to be created in each component. I can't really verify that this fixes your issue because the stackblitz does not appear to reproduce the problem you're describing.
for some reason the editor gave me error until I added the router in providers.
The solution is removing the Router from the component's provider.
Thank u
Which @angular/* package(s) are the source of the bug?
router
Is this a regression?
Yes
Description
PLEASE NOTE: this explanation requires the provided code to be inspected.
Started investigating on an project were the behaviour was the following:
routing to / - correctly redirected to a
from /a navigating to /b via routerlink - correctly redirected to /b/c
from /b/c navigating to /b/d via routerlink - no action, navigation stuck - no messages in console, no debug in components' constructors or whatever, simply getting a static page with no behaviour
if instead I opened
/b - correctly redirected to /b/c
from /b/c to /b/d - navigation working as expected
putting up the stackblitz test project came out that the B component was missing Router as Provider (which is something new, never needed to add a provider -without injecting it in the constructor- and get tangible changes in the behaviour)
Then I observed the strange behaviour on stackblitz: routes cannot be accessed via absolute routing as described in the following section
Please provide a link to a minimal reproduction of the bug
https://stackblitz.com/edit/stackblitz-starters-ehkfrf?file=src%2Fapp%2Fd%2Fd.component.ts
Please provide the exception or error you saw
cannot access the routes using the absolute path (only able to navigate to them)
this is the sample routing created
when trying to navigate towards anything else but '/' this error is arised
GET https://stackblitzstartersehkfrf-b1w4--4200--14f85cda.local-credentialless.webcontainer.io/b/main.js net::ERR_ABORTED 404 (Not Found)
Please provide the environment you discovered this bug in (run
ng version
)Anything else?
is this related to stackblitz implementation?
The text was updated successfully, but these errors were encountered: