0
快速的問題(我希望): 我通過數據試圖ng-repeat
我$scope.discover
我用下面的代碼來填補範圍: `吳-重複火力地堡snap.val
const businessKey = '-KQ1hFH0qrvKSrymmn9d';
const rootRef = firebase.database().ref();
const discoverRef = rootRef.child('discover');
const businessRef = rootRef.child('businesses');
function getDiscoverBarContent(key, cb) {
discoverRef.child(key).on('child_added', snap => {
let businesRef = businessRef.child(snap.key);
businesRef.once('value', cb);
});
}
getDiscoverBarContent(businessKey, snap => {
console.log(snap.val());
$scope.discover = snap.val();
});`
And then a simple ng-repeat:
`<a ng-repeat="item in discover" >{{item.name}}</a>`
然而,這是不工作,並返回一行代碼:confused:任何想法,我哪裏出錯了?