AngularJS routing without the hash ‘#’

A Hashtag is not required in modern browsers, that support the Html5 API. First of all, you need to create a .htaccess file, then add to the code below.
Two important things that 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.
angular JS development , sreyas IT, SREYAS IT, Sreyas IT Solutions