0
我在我的應用程序中使用ngRoute
。該網址包含#
。當我嘗試使用瀏覽器刷新刷新頁面時,我的問題仍然存在。它重定向到主頁而不是當前頁面。Angularjs ngRoute瀏覽器刷新問題
我的當前頁面的URL是..../MyApp/#/admin
我的首頁網址..../MyApp/#/home
我以下列方式使用ngroute
路由:
$routeProvider.when('/home', {
templateUrl : './view/home.html',
controller : "homeCtrl"
})
.when('/admin', {
templateUrl : './view/admin.html',
controller : "adminController"
})
這不能在對服務器端處理了解太多的情況下回答。 – 31piy
添加.otherwise({redirectTo:'/ PAGENAME'});以更有效地處理這個問題 – Basith
你能提供一個工作的plnk(plnkr.co)嗎?這並沒有提供足夠的細節。你得到任何控制檯日誌? – Brian