do queries in firebase return an error callback?

3

Query in firebase returns some error function, I'm asking a question, but I will not always find something, how do I know if it's null?

  vm.settlements.child('liqui')
                .orderByChild("rut")
                .equalTo(employee.rut)
                .on("child_added", function (snapshot) {
                    $scope.keyExist = snapshot.val();
                    $scope.keyExistID = snapshot.key;
                });
    
asked by Luis Ruiz Figueroa 01.08.2017 в 05:50
source

1 answer

0

You just have to add it to the on method:

vm.settlements.child('liqui')
                .orderByChild("rut")
                .equalTo(employee.rut)
                .on("child_added", function (snapshot) {
                    $scope.keyExist = snapshot.val();
                    $scope.keyExistID = snapshot.key;
                }, function(error){
                    console.log(Error, error);
                });
    
answered by 11.10.2017 в 20:16