Problem mit html5Mode in anglejs
Ich versuche zu entfernenindex.html
der URL mithtml5Mode(true)
In Angularjs ist dies der Code:
angular.module('myApp', [
'ngRoute',
'myApp.filters',
'myApp.services',
'myApp.directives',
'myApp.controllers'
]).
config(['$routeProvider', '$locationProvider', function($routeProvider, $locationProvider) {
$locationProvider.html5Mode(true);
$routeProvider.when('/home', {templateUrl: 'views/home.html'});
$routeProvider.when('/about', {templateUrl: 'views/about.html'});
$routeProvider.otherwise({redirectTo: '/'});
}]);
Wenn ich nicht schreibe$locationProvider.html5Mode(true);
Die URL zeigt:
localhost: (port) /MyApplication/index.html
Wenn ich schreibe$locationProvider.html5Mode(true);
Die URL zeigt:
localhost: (port)
MyApplication
wird von der URL entfernt. Und ich möchte die URL zeigt:
localhost: (port) / MyApplication /
Was mache ich falsch? Was ist das Problem?
AKTUALISIEREN:
Wie sollte meine zeigen<a>
Stichworte? Gerade habe ich:
<a href="#/about">About</>
Wenn ich auf den Link klicke, zeigt die URL:
localhost: (port) /MyApplication/index.html#/about
Ich bin damit verloren.
Danke im Voraus!