Ich versuche, das Problem zu beheben mit $ locationProvider.html5Mode (true); beim Aktualisieren der Seite.
Es behebt dieses localhost/#/home
Hash in Urls, aber wenn ich die Seite aktualisieren zeigt es einen 404.
Ich verwende nginx local
.
Lauf angularjs v1.0.7
. Neueste Versionen funktionieren anscheinend nicht.
Kopf
<base href="/">
Angular
var app = angular.module('myApp', []);
app.config(function($routeProvider, $locationProvider) {
$routeProvider
.when('/', {
templateUrl: 'home.html',
title: 'home'
})
.when('/about', {
templateUrl: 'about.html',
title: 'about'
})
.when('/contact', {
templateUrl: 'contact.html',
title: 'contact'
})
.otherwise({
redirectTo: '/'
});
$locationProvider.html5Mode(true);
});