我需要从url中删除#hap键。我使用了这些代码吗?有什么要添加的吗?请找一个解决方案吗?
mySchoolApp.config(['$routeProvider', '$locationProvider', function($routeProvider, $locationProvider) {
//$locationProvider.html5Mode(true);
$routeProvider
.when("/", {
templateUrl: "templates/login.html",
title: 'Login Page',
controller: "mainController"
})
.when("/login", {
templateUrl: "templates/login.html",
title: 'Login Page',
controller: "mainController"
})
.when("/forgot", {
templateUrl: "templates/forgot.html",
title: 'Forgot Page',
controller: "mainController"
})
.otherwise({
redirectTo: '/404'
});
$locationProvider.html5Mode(true);
}]);
答案 0 :(得分:0)
您需要在html标题上添加基本标记,如下所示:
<base href="/" />