繁体   English   中英

为什么没有根请求获取更新的index.html

[英]Why doesn't root request get the updated index.html

我正在开发一个有角度的应用程序。 每当我修改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/zh-CN/docs/Web/API/Location.reload

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM