Answer the question
In order to leave comments, you need to log in
AngularJs ngRoute why don't links like "#" and "/" work?
While studying AngularJs and ngRoute, I encountered the problem of links like "#" and "/" are not
processed by ngRoute and the transition to / does not work even when specified: $routeProvider.otherwise({ redirectTo: '/' });
Sequence of actions:
Answer the question
In order to leave comments, you need to log in
For disabled html5, the # mod is used by Angular as a delimiter for $location(). At the moment, there are already few browsers without support for the history API , so you can safely enable the html5 mod in Angular. This will make the links pretty (remove the #).
How to enable:
1. https://docs.angularjs.org/api/ng/provider/$locati... html5Mode method.
2. Set up redirects to index.html for the server. settings for different servers
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question