【问题标题】:Angularfire crashes browser when savedAngularfire在保存时崩溃浏览器
【发布时间】:2017-04-17 04:33:00
【问题描述】:

我正在对 Angularfire 进行测试,每次我将对象保存到基础时,浏览器都会崩溃。屏幕向上升级,但我必须停止执行选项卡并刷新页面,以便浏览器再次正常工作。

有人知道是什么原因造成的吗?

Firefox Crashes

以下是保存对象时的控制器代码。

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();
}
});

【问题讨论】:

    标签: angularjs firebase-realtime-database angularfire


    【解决方案1】:

    尝试使用旧版本的 firebase.. 我遇到了同样的问题

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-01-06
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-07-14
      • 1970-01-01
      相关资源
      最近更新 更多