title: how to get headers from response in angularjs
body: <p>This is my sample, i'm not get response headers, it returns undefined
  I'm trying to get custom response headers like reponse.header['X-auth-token'] but it returns undefined</p>
  
  <p>I'm new to angular js, Please share your idea </p>
  
  <p>Thanks in advance</p>
  
  <p>//I'm trying to get custom response headers here (using alert(response.headers);)</p>
  
  <h2>Controller</h2>
  
  <pre><code>UIAppRoute.controller('test', ['$scope', 'checkStatus', function($scope, checkStatus) {
      $scope.data = {};
      checkStatus.query(function(response) {
          alert(response.headers);
          angular.forEach(response, function (item) {
               alert("resp2"+ item);
           });
        $scope.data.resp = response;
      });
  }]);
  
  
  // sending request to server
  service
  -------
  UIAppResource.factory('checkStatus', function($resource){
      var auth = Base64.encode("abcde:abcde");
      return $resource(baseURL + "status", {},
          {
              'query': {
                  method: 'GET',
                  headers: {
                      'Accept':'application/json',
                      'Content-Type':'application/json',
                      'Authorization': 'Basic '+ auth,
                      'Access-Control-Allow-Headers' : 'Origin, X-Requested-With, Content-Type, Accept'
                 },
                  isArray: false
              }
          }
      )
  </code></pre>
  
  <p>how to get headers from response in angularjs ?
  Please share your idea </p>
  
  <p>Thanks in advance</p>