code: function(event, rec, prevChild) {
            var key = this.$$getKey(rec);
            var changed = false;
            var curPos;
            switch(event) {
              case 'child_added':
                curPos = this.$indexFor(key);
                break;
              case 'child_moved':
                curPos = this.$indexFor(key);
                this._spliceOut(key);
                break;
              case 'child_removed':
                // remove record from the array
                changed = this._spliceOut(key) !== null;
                break;
              case 'child_changed':
                changed = true;
                break;
              default:
                throw new Error('Invalid event type: ' + event);
            }
            if( angular.isDefined(curPos) ) {
              // add it to the array
              changed = this._addAfter(rec, prevChild) !== curPos;
            }
            if( changed ) {
              // send notifications to anybody monitoring $watch
              this.$$notify(event, key, prevChild);
            }
            return changed;
          }
docs: Handles placement of recs in the array, sending notifications,
  and other internals. Called by the synchronization process
  after $$added, $$updated, $$moved, and $$removed return a truthy value.
  
  @param {string} event one of child_added, child_removed, child_moved, or child_changed
  @param {object} rec
  @param {string} [prevChild]
  @protected