Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angularjs/24.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Angularjs 在Angular JS ui路由器中获取接收到的Http头_Angularjs_Angular Ui Router_Http Headers - Fatal编程技术网

Angularjs 在Angular JS ui路由器中获取接收到的Http头

Angularjs 在Angular JS ui路由器中获取接收到的Http头,angularjs,angular-ui-router,http-headers,Angularjs,Angular Ui Router,Http Headers,我是一个有棱角的新手。 我有下面的Angular JS(v.1.7)ui路由器 .state('helpPage', { url: "/help", data: { roles: [] }, views: { helpDoc: { templateUrl: 'app/modules/help/help.tpl.html', controller: 'helpCtrl'

我是一个有棱角的新手。 我有下面的Angular JS(v.1.7)ui路由器

.state('helpPage', {
    url: "/help",
    data: {
        roles: []
    },
    views: {
        helpDoc: {
            templateUrl: 'app/modules/help/help.tpl.html',
            controller: 'helpCtrl'
        }
    }
})
当用户点击这个页面时,我想检索标题。 我可以在控制器或ui路由的解析方法本身中获取它们吗

尝试了HttpInterceptor,但没有帮助


非常感谢您的帮助。

使用$http
响应
对象的
标题
属性:

$http.head(url).then(function(response) {
     var headerGetter = response.headers;
     console.log(headerGetter("headerName"));
});
有关详细信息,请参阅


是否有http响应?