src/database/FirebaseObject.js
function FirebaseObject(ref) {
        if( !(this instanceof FirebaseObject) ) {
          return new FirebaseObject(ref);
        }
        var self = this;
        // These are private config props and functions used internally
        // they are collected here to reduce clutter in console.log and forEach
        this.$$conf = {
          // synchronizes data to Firebase
          sync: new ObjectSyncManager(this, ref),
          // stores the Firebase ref
          ref: ref,
          // synchronizes $scope variables with this object
          binding: new ThreeWayBinding(this),
          // stores observers registered with $watch
          listeners: []
        };

        // this bit of magic makes $$conf non-enumerable and non-configurable
        // and non-writable (its properties are still writable but the ref cannot be replaced)
        // we redundantly assign it above so the IDE can relax
        Object.defineProperty(this, '$$conf', {
          value: this.$$conf
        });

        this.$id = ref.ref.key;
        this.$priority = null;

        $firebaseUtils.applyDefaults(this, this.$$defaults);

        // start synchronizing data with Firebase
        this.$$conf.sync.init();

        // $resolved provides quick access to the current state of the $loaded() promise.
        // This is useful in data-binding when needing to delay the rendering or visibilty
        // of the data until is has been loaded from firebase.
        this.$resolved = false;
        this.$loaded().finally(function() {
          self.$resolved = true;
        });
      }
function FirebaseObject(ref) {
        if( !(this instanceof FirebaseObject) ) {
          return new FirebaseObject(ref);
        }
        var self = this;
        // These are private config props and functions used internally
        // they are collected here to reduce clutter in console.log and forEach
        this.$$conf = {
          // synchronizes data to Firebase
          sync: new ObjectSyncManager(this, ref),
          // stores the Firebase ref
          ref: ref,
          // synchronizes $scope variables with this object
          binding: new ThreeWayBinding(this),
          // stores observers registered with $watch
          listeners: []
        };

        // this bit of magic makes $$conf non-enumerable and non-configurable
        // and non-writable (its properties are still writable but the ref cannot be replaced)
        // we redundantly assign it above so the IDE can relax
        Object.defineProperty(this, '$$conf', {
          value: this.$$conf
        });

        this.$id = ref.ref.key;
        this.$priority = null;

        $firebaseUtils.applyDefaults(this, this.$$defaults);

        // start synchronizing data with Firebase
        this.$$conf.sync.init();

        // $resolved provides quick access to the current state of the $loaded() promise.
        // This is useful in data-binding when needing to delay the rendering or visibilty
        // of the data until is has been loaded from firebase.
        this.$resolved = false;
        this.$loaded().finally(function() {
          self.$resolved = true;
        });
      }
function FirebaseObject ( ref ) { if ( ! ( this instanceof FirebaseObject ) ) { return new FirebaseObject ( ref ) ; } var self = this ; // These are private config props and functions used internally // they are collected here to reduce clutter in console.log and forEach this . $$conf = { // synchronizes data to Firebase sync : new ObjectSyncManager ( this , ref ) , // stores the Firebase ref ref : ref , // synchronizes $scope variables with this object binding : new ThreeWayBinding ( this ) , // stores observers registered with $watch listeners : [ ] } ; // this bit of magic makes $$conf non-enumerable and non-configurable // and non-writable (its properties are still writable but the ref cannot be replaced) // we redundantly assign it above so the IDE can relax Object . defineProperty ( this , '$$conf' , { value : this . $$conf } ) ; this . $id = ref . ref . key ; this . $priority = null ; $firebaseUtils . applyDefaults ( this , this . $$defaults ) ; // start synchronizing data with Firebase this . $$conf . sync . init ( ) ; // $resolved provides quick access to the current state of the $loaded() promise. // This is useful in data-binding when needing to delay the rendering or visibilty // of the data until is has been loaded from firebase. this . $resolved = false ; this . $loaded ( ) . finally ( function ( ) { self . $resolved = true ; } ) ; }
Creates a synchronized object with 2-way bindings between Angular and Firebase.

@param {Firebase} ref
@returns {FirebaseObject}
@constructor
Creates a synchronized object with 2 - way bindings between Angular and Firebase .