我正在尝试使用AngularJS API在Firebase中创建以下结构,但没有任何成功: 例如,在https://something.firebaseio.com/
中+ {element: "node"} // https://something.firebaseio.com/element
+ {array: // https://something.firebaseio.com/array
{Name1: "element#1"}, // https://something.firebaseio.com/array/Name1
{Name2: "element#2"}
}
另外,从Firebase设置/获取这些值的正确方法是什么?
我这样做,但似乎错了:
$scope.app = $firebase(new Firebase("https://something.firebaseio.com/"));
$scope.array = app.$child('array');
$scope.array.$push({Name1: "element#1"}); // I know it creates uid in firebase for this object
$scope.app.$set({element: "node"});
如果仍然不清楚,请在评论中告诉我 感谢,