我正在对Angularfire进行测试,每次将对象保存到基础时,浏览器都会崩溃。屏幕升级已升级,但我必须停止执行选项卡并刷新页面,以便浏览器再次正常工作。
有人知道可能导致问题的原因吗?
以下是保存对象时的控制器代码。
angular.module("AlbionTrading").controller("indexCtrl", function ($scope, $firebaseObject, $firebaseArray) {
//Pega objeto direto no Firebase
var ref = firebase.database().ref('AppSettings/');
// download the data into a local object
var syncObject = $firebaseObject(ref);
// synchronize the object with a three-way data binding
// click on `index.html` above to see it used in the DOM!
syncObject.$bindTo($scope, "appName");
//Pega array de objetos no Firebase
var cities = firebase.database().ref('Cities/');
$scope.cities = $firebaseArray(cities);
var posts = firebase.database().ref('Posts/');
$scope.posts = $firebaseArray(posts);
$scope.adicionarPost = function (post) {
console.log(post);
$scope.posts.$add({
Cidade: post.Cidade.Name,
Text: post.Text
});
delete $scope.post;
$scope.postForm.$setPristine();
}
});
答案 0 :(得分:0)
尝试使用较旧版本的firebase ..我遇到了同样的问题