var position;
//made up class
var fakeclass = "CS250";

$(function(){
    var options = {
    enableHighAccuracy: true,
    timeout: 5000,
    maximumAge: 0
  };

  function success(pos) {
    position = pos.coords;


  };

  function error(err) {
    console.warn('ERROR(' + err.code + '): ' + err.message);
  };

  navigator.geolocation.getCurrentPosition(success, error, options);
});
angular.module('angularfireSlackApp')
  .factory('Users', function($firebaseArray, $firebaseObject, FirebaseUrl){
    var usersRef = new Firebase(FirebaseUrl+'users');
    var connectedRef = new Firebase(FirebaseUrl+'.info/connected');
    var users = $firebaseArray(usersRef);
    var locationKey;

    var Users = {
      getProfile: function(uid){
        return $firebaseObject(usersRef.child(uid));
      },
      getDisplayName: function(uid){
        return users.$getRecord(uid).displayName;
      },
      all: users,

      getGravatar: function(uid){
        return '//www.gravatar.com/avatar/' + users.$getRecord(uid).emailHash;
      },
      setOnline: function(uid){
        var connected = $firebaseObject(connectedRef);
        var online = $firebaseArray(usersRef.child(uid+'/online'));

        connected.$watch(function (){
          if(connected.$value === true){
            online.$add(true).then(function(connectedRef){
              connectedRef.onDisconnect().remove();
            });
          }
        });
      },
      setLocation: function(uid){

        var connected = $firebaseObject(connectedRef);
        var location = $firebaseArray(usersRef.child(uid+'/location'));
        var coordinates = {
          lat : position.latitude,
          lng : position.longitude
        };
        console.log(coordinates);
        connected.$watch(function (){
          if(connected.$value === true){
            location.$add(coordinates).then(function(connectedRef){
              connectedRef.onDisconnect().remove();
              locationKey = connectedRef.key();

              console.log(FirebaseUrl+'users/'+uid+'/location/'+locationKey);
            });
          }
        });
      },
      unsetLocation: function(uid){
        var location = new Firebase(FirebaseUrl+'users/'+uid+'/location/'+locationKey);
        var data;

        location.on("value", function(snapshot) {
        });
        var locationArray = $.map(data, function(value, index) {
            return [value];
        });

        console.log(locationArray);

        var user= new Firebase(FirebaseUrl+'users/'+uid);
        user.child('location').remove(function(error){
            if (error) {
            console.log("Error:", error);
          } else {
            console.log("Removed successfully!");
          }
        });
      },
      setClass: function(uid){
        var classes = new Firebase(FirebaseUrl+'users/'+uid+'/class/');
        classes.set('CS290');
        //
        // classes[2].class = "CS260";
        // classes.$save(2).then(function(userRef) {
        //   userRef.key() === classes[2].$id; // true
        // });
      },
    };

    return Users;
  });

@@ -2793,42 +2793,38 @@
 s = 
-new F
+$f
 irebase
-(FirebaseUrl+'users/'+
+Array(usersRef.child(
 uid+
@@ -2834,213 +2834,43 @@
 lass
-/
 ')
-;%0A        classes.set('CS290');%0A        //%0A        // classes%5B2%5D.class = %22CS260%22;%0A        // classes.$save(2).then(function(userRef) %7B%0A        //   userRef.key() === classes%5B2%5D.$id; // true%0A        // %7D
+);%0A        classes.$add(fakeclass
 );%0A 

Revert "add class to firebase button"