为什么Angular不加载我的部分?

时间:2014-02-15 05:08:46

标签: javascript angularjs

我有一个AngularJS应用程序,它使用partials加载页面。但是,有时这些部分不会加载。我能够在Fiddler中捕获一个,似乎返回的状态是206(使用字节范围的“部分内容”)。由于某种原因,请求具有Range标头:

GET http://brian:90/Offices/Details/Details.html HTTP/1.1
Host: brian:90
Connection: keep-alive
Cache-Control: max-age=0
Accept: application/json, text/plain, */*
User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/32.0.1700.107 Safari/537.36
Referer: http://brian:90/Office/18207
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-US,en;q=0.8
Cookie: XXX
Range: bytes=3695-3695
If-Range: "80f21e2992acf1:0"

以下是回复:

HTTP/1.1 206 Partial Content
Content-Type: text/html
Content-Encoding: gzip
Last-Modified: Sat, 15 Feb 2014 04:48:25 GMT
Accept-Ranges: bytes
ETag: "80f21e2992acf1:0"
Vary: Accept-Encoding
Server: Microsoft-IIS/8.5
Glimpse-RequestID: 7b58956c-2917-457c-b47d-d602fb304d59
Access-Control-Allow-Origin: *
X-Powered-By: ASP.NET
Date: Sat, 15 Feb 2014 04:54:16 GMT
Content-Length: 1
Content-Range: bytes 3695-3695/4135

?

这是路线配置......

officeApp.config(['$routeProvider', function ($routeProvider) {
    $routeProvider
        .when('/summary', {
            title: 'Summary',
            templateUrl: '/Offices/Summary/Summary.html',
            controller: 'summaryCtrl'
        })
        .when('/reports', {
            Title: 'Reports',
            templateUrl: '/Offices/Reports/Reports.html',
            controller: 'reportsCtrl'
        })
        .when('/details', {
            Title: 'Details',
            templateUrl: '/Offices/Details/Details.html',
            controller: 'detailsCtrl'
        })
        .when('/logos', {
            Title: 'Logos',
            templateUrl: '/Offices/Logos/Logos.html?v=2',
            controller: 'logosCtrl'
        })
        .when('/agents', {
            Title: 'Agents',
            templateUrl: '/Offices/Agents/Agents.html',
            controller: 'agentsCtrl'
        })
        .when('/theme', {
            Title: 'Tour Theme',
            templateUrl: '/Offices/Theme/Theme.html',
            controller: 'themeCtrl'
        })
        .when('/packages', {
            Title: 'Packages',
            templateUrl: '/Offices/Packages/Packages.html',
            controller: 'packagesCtrl'
        })
        .when('/admin', {
            Title: 'CS Admin',
            templateUrl: '/Offices/Admin/Admin.html',
            controller: 'adminCtrl'
        })
        .otherwise({ redirectTo: '/summary' });
}]);

知道发生了什么事吗?为什么Angular请求只有一个字节的字节范围?

0 个答案:

没有答案