Angular JS routing without ‘#’ is possible as ‘#’ is not required in modern browsers, that support the Html5 API. First of all, you need to create a .htaccess file, then add it to the code below.
Two important things need to be done.
1. Configuration of $location provider.
2. Setting/Add base for relative links.
- In Router section , add html5 Mode(true);
app.config(function($routeProvider,$locationProvider) { $routeProvider.when('/home', { templateUrl:'/html/home.html'}); $locationProvider.html5Mode(true); })
- Add base tag in Html head.