AngularJS - доступ к заголовкам http

Я пытаюсь получить доступ к заголовкам http в моем угловом контроллере, но я получаю неопределенный. Кроме того, я могу видеть ответ заголовка в моем угловом сервисе, который не отражается в моем контроллере. Может кто-нибудь сказать мне, что мне не хватает? Пожалуйста, смотрите код ниже:

Обслуживание:

cmApp.service('supplierService', function ($http, $q) {
    this.getSuppliers = function (orderByColumn, skipRows, takeRows) {
        var deferred = $q.defer();
        $http({
            method: 'GET',
            url: 'api/supplier',
            params: { orderBy: orderByColumn, skip: skipRows, take: takeRows },
            timeout: 30000, 
            cache: false
        }).
        success(function (data, status, headers, config) {
            // any required additional processing here            
            deferred.resolve(data, status, headers, config);            
        }).
        error(function (data, status) {
            deferred.reject(data, status, headers, config);
        });
        return deferred.promise;        
    }

контроллер:

   supplierService.getSuppliers($scope.orderby, $scope.skip, $scope.take)
        .then(function (data, status, headers, config) {
            **//getting undefined here.**
            $scope.totalRecords = parseInt(headers('X-TotalRowCount'));                
            $scope.suppliers = data;
        }, function (error) {
            // error handling here
        });