title: Console returns a promise object instead of the value
body: <p>I have already read this question <a href="https://stackoverflow.com/questions/30146045/how-to-access-json-object-state-value">How to access JSON Object.$$state.value?</a> and I applied the suggestion, but I still have a promise object as a return of the console.</p>
  
  <p>This is the asynchronous function inside the service: </p>
  
  <pre><code>function getData(myUrl){
      var newref = new Firebase(myUrl);
  
      return $q(function(resolve, reject){
          newref.once("value", function(snapshot){
              var data = snapshot.val();
              var newUsername = data.username;
              resolve(newUsername);      
          }) 
      });
  }
  </code></pre>
  
  <p>And this is the return of the service: </p>
  
  <pre><code>return{
      getUsername: function(){
          var url = userUrl();
          var promise = getData(url);
          return promise.then(function(whatIneed){
              return whatIneed ;
          })  
      }
  };
  </code></pre>
  
  <p>In the controller I call "getUsername":</p>
  
  <pre><code>var user = CommonService.getUsername();
  console.log(user);
  </code></pre>
  
  <p>I have this return in the console:
  <a href="https://i.stack.imgur.com/8nviC.png" rel="nofollow noreferrer">Console log</a></p>
  
  <p>I would like to ave the string"Damiano" (the value) insted of the promise object.
  Why I still have a promise object? 
  Where is the code wrong?</p>
  
  <p>Thanks in advance</p>