I have an Angular.js webapp that employs ui-router (https://github.com/angular-ui/ui-router) w/parallel named views like such:
.state(
'app.experience', {
url: 'e/:experienceId',
views: {
'center-pane@': {
templateUrl: 'partials/experience.html',
controller: 'ExperienceController'
}
})
I enabled HTML5 pushState via
$locationProvider.html5Mode(true);
When
http://www.mysite.com/e/123
is requested, my backend sends back the index.html at the root directory. (as per Using HTML5 pushstate on angular.js) However, when the browser receives index.html and begins to fetch all the css/js resources, the requests are for
/e/js/script1.js
as opposed to
/js/script1.js
which only exists at the root level. It seems to default the root directory as mysite.com/e/
(from the requested url) and not the actual root, mysite.com/
.
Is there something I'm missing here? Is it not possible to use relative srcs for my javascript and css in index.html?
Thanks for helping!