我正在用angularjs路由開發asp.net mvc項目。在重新載入頁面時產生一些路由錯誤。在我的應用程序中,Angularjs路由錯誤
如果我重新加載頁面,此頁面正常工作。但是,如果我重新加載下一頁,它會在'/'應用程序中顯示服務器錯誤。 HTTP:404錯誤。
.when('/computer', {
templateUrl: '/Selection_Routing/Selection_Product/Laptop.html',
controller: 'LaptopController'
})
我很感謝你的回答。
可能是舊的回答可以幫助你「 [http://stackoverflow.com/questions/20307655/404-error-with-angularjs-templateurl-routing](http://stackoverflow.com/questions/20307655/404-error-with-angularjs-templateurl-routing) 「 – Ronald
html5Mode是真的嗎? – dfsq
如果您使用Html5Mode,您的服務器需要配置以及角度。你使用什麼服務器技術?編寫UI-Router的人也編寫了一個非常好的常見問題解答,討論了這個問題並給出了很多流行服務器的配置選項:https://github.com/angular-ui/ui-router/wiki/Frequently-Asked-Questions#如何配置您的服務器到工作與html5mode – Claies