Skip to content

Instantly share code, notes, and snippets.

@erobit
Created June 7, 2015 20:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save erobit/86884f550891bb29f0e1 to your computer and use it in GitHub Desktop.
Save erobit/86884f550891bb29f0e1 to your computer and use it in GitHub Desktop.
Controller
Error: permission_denied: Client doesn't have permission to access the desired data.
destroy called for FirebaseArray: https://MYURL.firebaseio.com/contacts
Error: Cannot call $add method on a destroyed $firebaseArray object
angular.module('ContactApp')
.controller('ContactCtrl', function ($scope, Ref, $firebaseArray, $timeout) {
$scope.contact = {};
$scope.contacts = $firebaseArray(Ref.child('contacts'));
$scope.save = function(form) {
if (form.$isInvalid) {
return;
}
$scope.contacts.$add($scope.contact)
.catch(alert);
};
});
{
"rules": {
".read": false,
".write": true
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment