How to extend returned objects in the list returned by $asArray?

跟風遠走 提交于 2019-12-06 04:21:25

For the benefit of others, after reviewing the link that Kato posted, I was able to solve the issue by adding the following, almost all copied directly from the source except for the commented line below.

$$added: function(snap, prevChild) {

    var i = this.$indexFor(snap.name());
      if( i === -1 ) {

        var rec = snap.val();
        if( !angular.isObject(rec) ) {
          rec = { $value: rec };
        }
        rec.$id = snap.name();
        rec.$priority = snap.getPriority();
        $firebaseUtils.applyDefaults(rec, this.$$defaults);

        //This is the line that I added to what I copied from the source
        angular.extend(rec, printMessageObj);


        this._process('child_added', rec, prevChild);
      }
  }
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!