How to enable HTML5 mode in Angular 1.x?


Posted On: Feb 22, 2018


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

    Related Questions

    Please Login or Register to leave a response.

    Related Questions