我正在尝试使用ID搜索项目,但收到此消息。所有功能都正常工作。当执行我得到这个错误:使用AngularFire重建项目id使用AngularFire的Firebase
Storing data using array indices in Firebase can result in unexpected behavior. See https://www.firebase.com/docs/web/guide/understanding-data.html#section-arrays-in-firebase for more information.
我厂
.factory('TEST', function ($firebaseArray) {
var ref = new Firebase('https://shark-firebase.firebaseio.com');
return {
all: function(section) {
var data = $firebaseArray(ref.child(section));
return data;
},
get: function(section, id) {
var data = $firebaseArray(ref.child(section).child(id));
return data;
}
};
});
我尝试TOGETHER:
get: function(section, id) {
var data = $firebaseArray(ref.child(section));
return data.$getRecord(id);
}
和我的控制器:
万一,$ stateParams.section = 'posts'和$ stateParams.id ='0'。
$scope.loadItem = function(){
$scope.item = TEST.get($stateParams.section, $stateParams.id);
};
Thx很多,我不尝试混合数组和对象函数,thx再次! –