0
Hello,
I’m running some tests on Angularfire, and every time I save an object at the base, the browser crashes. The screen is even updated but I have to stop running the tab and refresh the page so that the browser works properly again.
Would anyone know what might be causing the problem?
Below the controller code when saving the object.
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();
}
});
Open the browser console, see if an error appears there. Must be giving stackoverflow and it is no pun with the name of the site, hehehe.
– Douglas Garrido
Hello Douglas, I tested again but nothing appeared on the console, only the very object I am saving that I had written on the console to check.
– Daybson