-1
我需要從url中刪除#散列鍵。並且我使用了這些代碼?是否有任何要添加的內容?請找到我的解決方案?在angularjs頁面重定向時刪除散列鍵
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);
}]);
雖然增加了LocationProvider我收到無差錯 [$位置:nobase將] HTTP://errors.angularjs .org/1.3.15/$ location/nobase – ArunJaganathan
點擊該鏈接....它向您解釋問題和解決方案! – charlietfl