code: function(data) {
            this._assertNotDestroyed('$add');
            var self = this;
            var def = $q.defer();
            var ref = this.$ref().ref.push();
            var dataJSON;
  
            try {
              dataJSON = $firebaseUtils.toJSON(data);
            } catch (err) {
              def.reject(err);
            }
  
            if (typeof dataJSON !== 'undefined') {
              $firebaseUtils.doSet(ref, dataJSON).then(function() {
                self.$$notify('child_added', ref.key);
                def.resolve(ref);
              }).catch(def.reject);
            }
  
            return def.promise;
          }
docs: Create a new record with a unique ID and add it to the end of the array.
  This should be used instead of Array.prototype.push, since those changes will not be
  synchronized with the server.
  
  Any value, including a primitive, can be added in this way. Note that when the record
  is created, the primitive value would be stored in $value (records are always objects
  by default).
  
  Returns a future which is resolved when the data has successfully saved to the server.
  The resolve callback will be passed a Firebase ref representing the new data element.
  
  @param data
  @returns a promise resolved after data is added