title: can't access json object returned from express get route in angular
body: <p>I have an express route that returns the following JSON</p>
  
  <pre><code>[{"_id":"573da7305af4c74002790733","postcode":"nr22ry","firstlineofaddress":"20 high house avenue","tenancynumber":"12454663","role":"operative","association":"company","hash":"b6ba35492f3f83a79395386cfc601178dfd11de723d2007daf6bd34160a9ff16c87b1f07835e7a39c20454c6271960930211b365ae05c620809c159a3d7b97de","salt":"8d544f21c436494da859cf5895c414d9","username":"yhy","__v":0}]
  </code></pre>
  
  <p>In my angular app i have a factory with the following code</p>
  
  <pre><code>auth.userRole = function() {
     alert('here');
     if (auth.isLoggedIn()){
            return $http.get('/roles/' + auth.currentUser(), {
  headers: {Authorization: 'Bearer '+auth.getToken()}
    }).then(function(response){          
      //the info is here, i just can't get to it!!!
  
      return response;          
    });   
     }
  };
  </code></pre>
  
  <p>that is called in my controller</p>
  
  <pre><code>$scope.therole = auth.userRole(); 
  </code></pre>
  
  <p>In my view i have </p>
  
  <h3>user role is: {{ therole }}</h3>
  
  <p>My problem is that whilst when i debug (using chrome) my angular, is can see that response has the json in it (see below),  i can't access it! I've tried different permutations of returning response.data or response.data.role or response.role or response[0].role, etc etc, none of these work either return blank or causing a 'property not defined error'.
  This should be straightforward so i'm obviously doing something really stupid. Please help!</p>
  
  <pre><code>Object
  config
  :
  Object
  data
  :
  Array[1]
  0
  :
  Object
  __v
  :
  0
  _id
  :
  "573da7305af4c74002790733"
  association
  :
  "company"
  firstlineofaddress
  :
  "20 high house avenue"
  hash
  :
   "b6ba35492f3f83a79395386cfc601178dfd11de723d2007daf6bd34160a9ff16c87b1f07835e7a39c20454c6271960930211b365ae05c620809c159a3d7b97de"
  postcode
  :
  "nr22ry"
  role
  :
  "operative"
  salt
  :
  "8d544f21c436494da859cf5895c414d9"
  tenancynumber
  :
  "12454663"
  username
  :
  "yhy"
  </code></pre>