0
我試圖用html提供程序實現角度js狀態更改。但是當我嘗試刷新頁面時頁面顯示404錯誤。問題是什麼。 ?角度js頁面刷新不起作用
我的狀態提供商
$stateProvider
.state('home', {
url: '/Edu',
views: {
'[email protected]': {
templateUrl: 'dashboard.html',
controller: 'dashCtrl'
}
},
params: {'registerData' : ''}
})
.state('dash_home', {
url: '/dash_home',
views: {
'[email protected]': {
templateUrl: 'dash_home.html',
controller: 'dashCtrl'
}
},
params: {'registerData' : ''}
})
.state('login', {
url: '/login',
views: {
'[email protected]': {
templateUrl: 'login.html',
controller: 'dashCtrl'
}
},
params: {'registerData' : ''}
});
HTML5的conf是,
app.config(function($locationProvider) {
$locationProvider.html5Mode(false);
});
,也把
<base href="/">
在HTML頁面。但它沒有工作。
編輯
server {
listen 80 ;
listen [::]:80 ;
root /var/www/Edu;
location/{
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
root /var/www/Edu;
try_files $uri /index.html;
}
}
你在瀏覽器中輸入的網址是什麼? –
[重新加載頁面給AngularJS HTML5模式提供錯誤的GET請求](http://stackoverflow.com/questions/16569841/reloading-the-page-gives-wrong-get-request-with-angularjs-html5-模式) – Phil
url:Log In – jicks