angularjs - Get contents of child_added while watching firebaseArray -
i have simple private chat, different type of messages, when send server json structure pass message type too. $scope.messages = firechat.firebasearray; $scope.addmessage = function(e) { //add firebase $scope.messages.$add({ uid: $scope.authdata.uid, text: $scope.msg, timestamp: firebase.servervalue.timestamp, type: 'msg' }); $scope.msg = ""; //reset message }; as can see there property 'type'. now i'd watch new messages. in documentation there watch api function, returns id of record/message. i'd contents of message , check type there , according run other js functions. $scope.messages.$watch(function (data) { console.log("angularfire watch"); console.log(data); console.log(data.event); console.log(data.key); console.log(data.prevchild); }); above return child_added -jp6kzwlydtdetz8agpr , -jp6kzwlydtdetz8ospr . see, no body under key there possibility k...