title: angular $http get all headers
body: <p><strong>TL;DR;</strong></p>
  
  <p>I want to get all headers from the <code>$http</code> service and display them to the page. I don't care if it is only a list of the keys or the key/value pairs.</p>
  
  <ul>
  <li>How can I do this?</li>
  <li>Why has what I have been doing not working?</li>
  </ul>
  
  <p><strong>What I want to do</strong></p>
  
  <pre><code>  $http
      .get( '/data/?some=parameters&amp;go=here' )
      .success( function( response, status, headers ) {
        $scope.headers = headers();
      });
  </code></pre>
  
  <p>This outputs correctly in the Chrome console if I <code>console.log</code> either <code>headers()</code> or <code>$scope.headers</code>.</p>
  
  <p><strong>Only thing that I can do that works</strong></p>
  
  <pre><code>  $http
      .get( '/data/?some=parameters&amp;go=here' )
      .success( function( response, status, headers ) {
        $scope.headers['cache-control']     = headers('cache-control');
        $scope.headers['connection']        = headers('connection');
        $scope.headers['content-type']      = headers('content-type');
        $scope.headers['date']              = headers('date');
        $scope.headers['expires']           = headers('expires');
        $scope.headers['keep-alive']        = headers('keep-alive');
        $scope.headers['pragma']            = headers('pragma');
        $scope.headers['server']            = headers('server');
        $scope.headers['transfer-encoding'] = headers('transfer-encoding');
        $scope.headers['x-powered-by']      = headers('x-powered-by');
        // etc....
      });
  </code></pre>
  
  <p>This actually works in code, but I have to manually tell it every header to expect.</p>
  
  <p><strong>Meanwhile in my view</strong></p>
  
  <pre><code>&lt;div class="row" ng-repeat="(key,value) in headers"&gt;
    &lt;div class="col-xs-4 text-right"&gt;{{ key }}&lt;/div&gt;
    &lt;div class="col-xs-8 text-left"&gt;{{ value }}&lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>AngularJS v1.3.15 was hurt during the making of this question.</p>