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 }}
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
bug($location): incorrect URL parsing when (1) angular app lives under a subdirectory (2) HTML5 routing is off and (3) there's no trailing slash when accessing app root #2833
If there's trailing slash (i.e. http://localhost:5000/angular-app/), beginsWith(appBase, url) returns /. So withoutBaseUrl is set as /.
However, if there's no trailing slash (i.e. http://localhost:5000/angular-app), beginsWith(appBase, url) returns an empty string, and it evaluates beginsWith(appBaseNoFile, url), which returns angular-app. So withoutBaseUrl is set as angular-app.
As a result, when HTML5 route is off, this.$$parse behaves differently for http://localhost:5000/angular-app (no trailing slash) and http://localhost:5000/angular-app/ (trailing slash), even though they should return the same thing.
The change is introduced on this commit (cc @mhevery) 58ef323
This is not a problem when (1) HTML5 routing is on (e.g. $locationProvider.html5Mode(true).hashPrefix('!')) and (2) <base href="/angular-app/" is added to <head>.