googlearchive / angularfire-seed

Seed project for AngularFire apps
http://angularfire.com
MIT License
410 stars 191 forks source link

Error when I try to send the message on chat. #93

Closed vibgy closed 8 years ago

vibgy commented 8 years ago

Cannot call $add method on a destroyed $firebaseArray object

angular.js:11706 Error: Cannot call $add method on a destroyed $firebaseArray object
    at Object.FirebaseArray._assertNotDestroyed (angularfire.js:572)
    at Object.FirebaseArray.$add (angularfire.js:141)
    at Scope.$scope.addMessage (chat.js:10)
    at Array.$parseFunctionCall (angular.js:12474)
    at $parseStatements (angular.js:12242)
    at callback (angular.js:21700)
    at Scope.$eval (angular.js:14570)
    at Scope.$apply (angular.js:14669)
    at HTMLButtonElement.<anonymous> (angular.js:21705)
    at HTMLButtonElement.eventHandler (angular.js:3047)
katowulf commented 8 years ago

Hi @vibgy! Please provide a minimal repro and version info.

vibgy commented 8 years ago

Never mind. I'll close the issue. I had not configured the rules in firebase console properly. On Wed, Jan 27, 2016 at 7:54 AM katowulf notifications@github.com wrote:

Hi @vibgy https://github.com/vibgy! Please provide a minimal repro and version info.

— Reply to this email directly or view it on GitHub https://github.com/firebase/angularfire-seed/issues/93#issuecomment-175702377 .

ghost commented 8 years ago

Error, when I try to send the form to Firebase Cannot call $add method on a destroyed $firebaseArray object My security JSON

{
  "rules": {
    "projects": {
      ".read": "root.child('users').child(auth.uid).child('active').val() == true",
      ".write": true
    },
    "users": {
      "$users": {
      ".read": true,
      ".write": true
      }
    }
  }
}

Console error Error: Cannot call $add method on a destroyed $firebaseArray object at Object.d._assertNotDestroyed (https://cdnjs.cloudflare.com/ajax/libs/angularFire/1.1.3/angularfire.min.js:12:5167) at Object.d.$add (https://cdnjs.cloudflare.com/ajax/libs/angularFire/1.1.3/angularfire.min.js:12:1986) at Scope.$scope.addSurvey (http://localhost:9000/scripts/controllers/profile.js:73:35) at fn (eval at <anonymous> (http://localhost:9000/bower_components/angular/angular.js:14086:15), <anonymous>:4:218) at expensiveCheckFn (http://localhost:9000/bower_components/angular/angular.js:15076:18) at callback (http://localhost:9000/bower_components/angular/angular.js:24546:17) at Scope.$eval (http://localhost:9000/bower_components/angular/angular.js:16820:28) at Scope.$apply (http://localhost:9000/bower_components/angular/angular.js:16920:25) at HTMLButtonElement.<anonymous> (http://localhost:9000/bower_components/angular/angular.js:24551:23) at HTMLButtonElement.jQuery.event.dispatch (http://localhost:9000/bower_components/jquery/dist/jquery.js:4732:27)

katowulf commented 8 years ago

Once you call $destroy, you can no longer use the object. That's entirely the point.

Boasbabs commented 8 years ago

I had similar problems but i configured the rules in firebase console and it works properly