为什么root请求不获取更新后的index.html ?
Why doesn't root request get the updated index.html
我正在开发一个angular应用程序。每当我修改index.html时,对localhost:8000的请求不会得到更新的index.html。为什么呢?我使用nodejs来托管服务器。我已经被这个问题绊倒太多次了,假设请求会得到更新的index.html,比如包含一个新脚本,但是什么也没有发生,因为index.html不是更新的。每次刷新都要输入index.html.
app.config(['$locationProvider', '$routeProvider', function ($locationProvider, $routeProvider) {
$locationProvider.html5Mode(true);
$routeProvider.when('/', {
redirectTo : '/login'
}).when('/dashboard', {
templateUrl: 'app/dashboard/dashboard.html',
controller: 'dashboard'
}).when('/login', {
templateUrl: 'app/layout/login.html'
}).when('/register', {
templateUrl: 'app/layout/register.html'
}).otherwise({
redirectTo: '/'
});
}]);
可能是从浏览器缓存中加载的,而不是从服务器上更改的副本。
试
location.reload(true)
从服务器加载。
https://developer.mozilla.org/en-US/docs/Web/API/Location.reload相关文章:
- 分析高度属性时出现意外值{{specs.height}}.index.html
- AngularJS-需要在index.html页面中访问来自服务的数据
- index.html使用webpack开发服务器未重新加载
- 从index.html调用函数,该函数无限循环
- RouteChangeStart事件在初始index.html页面加载时触发
- Angular2:Index.html没有't显示该文件;正在加载&”;
- 如何使用gulp-inject将文件的内容插入到我的index.html中
- 使url匹配'/''/索引'和'/index.html'到单一状态
- 将所有angular2捆绑包包含在index.html中会使导入从内存获取数据,而不是再次从服务器请求数据
- 咕哝式发球;t将index.html与'/'要求
- AngularJS应用程序:如何将.js文件包含到index.html中
- 无法从index.html调用javascript函数
- 捕获刷新并将页面更改为index.html
- 添加java脚本后,Dropdown Menu无法在Index.html上工作
- jquery手机应用程序的第一页必须是index.html
- Angular 2-我如何使我的index.html文件的标题和关键字和描述的元标签是动态的
- 使index.html的默认状态不带#something
- 从'更改不同语言的图像;index.html'到'关于.html'
- ng递归地包括整个index.html;达到“10$digest()迭代”;
- angular-index.html只识别默认路由中定义的函数