Here is my app.js route file in AngularJS
var app = angular.module(\'myApp\', [\'ngRoute\', \'ngAnimate\', \'toaster\']);
app.config([\'$routeP
You can't inject $locationProvider in .run because providers are only available for .config
This answer should help but you will have 2 issues:
You will need a check before $locationProvider.html5Mode(true) as it will not work on IE 10 or older.
if(window.history && window.history.pushState){
$locationProvider.html5Mode(true);
}
This will work only by removing the # when the user enters it in the url, i.e. if the users types app/#/login it will change to app/login. However, if the user bookmarks or copies the changed url app/login and enters that in the browser he will get an error as the server does not know about angular routing since it is client side only. In the thread I linked above you may find some comments on how to fix this.