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.
Running an Angular app in a subdirectory is painful. All your routes, resources, locations, etc etc have to be manually prefixed with the application context. Example:
It's annoying and also error prone if your development env runs in a subdirectory (pretty common).
One current solution is to add a <base href="/myroot/"> tag to the document. This solves the problems from the Angular perspective but causes many issues of its own, especially for third-party libs/widgets that use anchors.
The ideal would be to make $location configurable with a base path, much like Backbone router's root config.
$locationProvider.baseHref="/myroot/";$location.path('/awesome');// goes to /myroot/awesome$routeProvider.when('/mypath', ...);//matched at /myroot/mypath$resource('/some/resource');//maps to /myroot/some/resource
This change would make running Angular in different contexts much easier.