我在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();
}
});发布于 2017-04-17 04:33:00
尝试使用旧版本的firebase..我也有同样的问题
https://stackoverflow.com/questions/43145690
复制相似问题