I want to enable HTML5 mode for my app. I have put the following code for the configuration.
return app.config(['$routeProvider','$locationProvider', function($routeProvider,$locationProvider) {
$locationProvider.html5Mode(true);
$locationProvider.hashPrefix = '!';
$routeProvider.when('/', {
templateUrl: '/views/index.html',
controller: 'indexCtrl'
});
$routeProvider.when('/about',{
templateUrl: '/views/about.html',
controller: 'AboutCtrl'
});
As you can see, I used the ^^$locationProvider.html5mode
and I changed all my links at the
ng-href
* to exclude the /#/.
*The Problem
How can I enable angular to get the correct page when I refresh?