How do you access loaded data from .$on('loaded') in AngularFire 0.5.0

前端 未结 2 1662
独厮守ぢ
独厮守ぢ 2020-12-29 16:36

I am having trouble accessing the data loaded from firebase using the .$on method in AngularFire 0.5.0

In the callback when I log out the contents of the scope the d

2条回答
  •  悲哀的现实
    2020-12-29 17:30

    Just for my own sake and others out there that may be having the same issue as i did, stumbling upon this question googling for the answer. My problem was that sometimes i was getting undefined as the value from the callback of $on('loaded').

    The way i solved it in the end was to use that event as a way of knowing when i could call the resource.$getIndex(), and the use the indexes returned from that to loop through the content and possibly store that in a new array to access the raw data.

提交回复
热议问题