嗨,我要只获取category =“ Tribal”的节点并将其作为Firebase数组对象返回。谢谢。
this.getSpecialTourPackage = function(){
var dbRef = firebase.database().ref('states').child('itineraries');
return $firebaseArray(dbRef);
};
if(_category != undefined && _category == 'Tribal'){
var loadedResult = [];
var resultArray = indiaTourService.getSpecialTourPackage();
resultArray.$loaded().then(function(data){
data.forEach(item =>{
loadedResult.push(item);
$scope.itineraries = _.where(loadedResult,{ category : "Tribal"});
});
});
}