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
{{ message }}
Repository navigation
APP_BASE_HREF doesn't work with routes which starts with the same text part #45744
P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgentarea: commonIssues related to APIs in the @angular/common packagearea: router
P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgentarea: commonIssues related to APIs in the @angular/common packagearea: router
Activity
atscott commentedon Apr 25, 2022
This is being caused by the
Locationclass, specifically thestripBaseHreflogic:angular/packages/common/src/location/location.ts
Lines 301 to 303 in 50004c1
Interestingly,
APP_BASE_HREFis not used unlessRouterModuleorUpgradeModuleis being used:angular/packages/common/src/location/location_strategy.ts
Lines 48 to 53 in 50004c1
Even more minimal repo: https://stackblitz.com/edit/angular-ivy-6wsoys?file=src%2Fapp%2Fapp.module.ts
Navigate to
/rulesand the path with displaylesrather thanrulesatscott commentedon Apr 25, 2022
As a workaround, you can provide your own
Location(copy-paste the existing implementation and adjust thenormalize/stripBaseHref)Dolgovec commentedon Apr 25, 2022
@atscott Thx for your answer and explanation! Workaround works fine for me
docs(common): Add note to location about investigating base href hand…
docs(common): Add note to location about investigating base href hand…
docs(common): Add note to location about investigating base href hand…
fix(common): Update `Location` to get a normalized URL valid in case …
fix(common): Update `Location` to get a normalized URL valid in case …
fix(common): Update `Location` to get a normalized URL valid in case …
angular-automatic-lock-bot commentedon Jan 12, 2023
This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.
fix(common): Update `Location` to get a normalized URL valid in case …
fix(common): Update `Location` to get a normalized URL valid in case …
fix(common): Update `Location` to get a normalized URL valid in case …
fix(common): Update `Location` to get a normalized URL valid in case …