title: Pass a request header to uriTemplate in AngularJS
body: <p>I have this Angular code:</p>
  
  <pre><code>    .state('UserTables', {
          url: '/Tables',
          resolve: {
              auth: function resolveAuthentication(SessionService) {
                  return SessionService.isUser();
              }
          },
          views: {
              "containerMain": {
                  templateUrl: 'Views/Tables',
                  controller: TableController
              },
          }
      })
  </code></pre>
  
  <p>And would like to pass some request header to the templateUrl call.</p>
  
  <p>Anyone done something like that?</p>
  
  <p>Basically I have a REST service that can generate the view I need depending on 1 header and some property's. Property's are no problem but I have no clue how to make a call to the service and wait for the result.</p>
  
  <p><em>Tried:</em></p>
  
  <pre><code>        views: {
              "containerMain": {
                  template: function (SessionService, $http, $q) {
                      console.log('template');
                      var resp = SessionService.getTable($http, $q, 'Generate/Table?objectId=WfObject');
                      var r = '';
                      resp.then(function (result) {
                          r = result;
                          console.log('resp:', r);
                      });
                      console.log('r:',r);
                      return r;
                  }
  </code></pre>