title: Angularfire current logged in user's data
body: <p>I am using Angularfire for my login system and trying to get current logged in user's username for purpose of using in controller. Firts getting  <code>uid</code> from <code>$getAuth</code> and sync it with data in database. But what I am trying below is not working.</p>
  
  <pre><code>.factory("Auth", function($firebaseAuth) {
  var ref = new Firebase("URL");
  return $firebaseAuth(ref);
  })
  
  .factory("Konusma", function($firebaseObject) { //When you give user's uid to this factory its gives you user data in database.
  return function(xm) {
          var ref = new Firebase("URL");
          var userdata = ref.child('users').child(xm);
          return $firebaseObject(userdata);
  }})
  
  .controller("chatCtrl", function(Auth, Konusma) {
  
  var userx = Auth.$getAuth(); //Current logged in user's uid and email
  
  var chatci = function() { //Trying to get current logged in user's username and other data according to uid which is comes from Auth.$getAuth.
  
          Konusma(userx.uid).$loaded().then(function(data){
          return data.username;
      });
  
  };
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/zZxiw.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/zZxiw.png" alt="enter image description here"></a></p>