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