title: getting single objects out of $angularfire/$firebase
body: <p>I am trying to follow a tutorial on lynda.com which uses angularfire (angularjs firebase) except it uses stuff like $firebase.$asObject and such, which is now obsolete.  I tried to look at the documentation as well as some other SOF questions, and I finally found something that worked, but it looks ugly and seems quite inefficient since the only way I found for it to work is to iterate through all the objects in an array returned from the database.  This array holds all the users which are registered.  This is how I got it to work, but can someone tell me the correct way to do it, because this does not seem like it should be it.</p>
  
  <pre><code>var ref = new Firebase(FIREBASE_URL);
  var auth = firebaseAuth(ref);
  
  auth.$onAuth(function(authUser){
      if(authUser){
          var ref = new Firebase(FIREBASE_URL + 'users/');
          var stuff = firebaseArray(ref);
  
           ref.on('value', function(snapshot) {
              if(snapshot.val() !== null) {
                  var keys = Object.keys(snapshot.val());
                  for(var key in keys){
                      if(keys.hasOwnProperty(key)){
                          if(authUser.uid === snapshot.val()[keys[key]].registeredUser){
                             rootScope.currentUser = snapshot.val()[keys[key]];
                          }
                      }
                  }
              } else {
                  console.log('location does not exist');
              }
            });
  
          var user = firebaseObject(ref);
          //console.log(user);
          rootScope.currentUser = user;
      } else {
          rootScope.currentUser = '';
      }
  });
  </code></pre>
  
  <p>Here is what my firebase forge looks like:</p>
  
  <p><img src="https://i.stack.imgur.com/VEqaq.png" alt="Firebase Forge"></p>
  
  <p>Thank you in advance!</p>