html5Mode method of $locationProvider module is used to enable HTML5 mode in Angular 1.x. For creating pretty URLs and removing # from URLs html5Mode need to true.

Enabling html5Mode to true in Angular 1.x.

angular.module(‘myApp’, [])

.config(function($routeProvider, $locationProvider) {

.when(‘/’, {
templateUrl : ‘partials/home.html’,
controller : mainController

// use the HTML5 History API

Leave a Reply

Your email address will not be published. Required fields are marked *