I am using ui-router and have a profile state that looks like this:
.state('profile', { url: "/profile", templateUrl: "views/profile.html", controller: 'ProfileCtrl', resolve: { currentUser: function(gamAuth){ return gamAuth.checkCurrentUser(config.userRol.user) } }
When I try to reload / refresh the page, I get the following message:
Cannot GET /profile
The problem does not occur when I load my "landing page" at: http://localhost:9000/ , which has the following state in $stateProvider :
.state('home', { url: "/", [...] })
I use: $locationProvider.html5Mode(true);
I tried providing an absolute url as suggested in the Decision Tree here
I also tried a number of suggestions found on the Internet, the most popular of which is something in this direction (putting it in the app.run() section):
$state.transitionTo($state.current, $stateParams, { reload: true, inherit: false, notify: true });
All approaches have been tested with the <base href="/"> present in the <head> my index.html . Thank you for your time.
source share