By default AngularJs formats the URL as follows:
http://dominio.com.br/#/login
How do I leave it as follows?
http://dominio.com.br/login
By default AngularJs formats the URL as follows:
http://dominio.com.br/#/login
How do I leave it as follows?
http://dominio.com.br/login
It's two simple steps:
$locationProvider
angular.module('app', [])
.config(function($routeProvider, $locationProvider) {
$routeProvider
.when('/', {
templateUrl : 'home.html',
controller : homeController
})
.when('/sobre', {
templateUrl : 'sobre.html',
controller : sobreController
});
// habilitar o uso da API HTML5 History
$locationProvider.html5Mode(true);
});
<html>
<head>
<base href="/">
</head>
Source: Beautiful URLs in AngularJS: Removing # >