Firebase angularfire child.$asObject give properties undefined

前端 未结 1 1687
星月不相逢
星月不相逢 2020-12-07 05:48

I\'ve got this code:

factory

app.factory(\'Items\', function($firebase,FIREBASE_URL) {
    var ref = new Firebase(FIREBASE_URL);
            


        
相关标签:
1条回答
  • 2020-12-07 06:15

    This is because by the time your console.log($scope.item.url); runs, the data hasn't been loaded from Firebase yet. Angular listens for a notification from Firebase/AngularFire to know when the data has loaded and then updates the view.

    Also see angularfire - why can't I loop over array returned by $asArray? and Trying to get child records from Firebase.

    0 讨论(0)
提交回复
热议问题