Hello,
I'm doing tests on Angularfire, and every time I save an object to the base, the browser crashes. The screen is up to date but I have to stop the execution of the tab and refresh the page for the browser to work properly again.
Would anyone know what might be causing the problem?
Belowthecontrollercodewhensavingtheobject.
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();
}
});