This function is used to update and save the data into the firebase database. It's not working properly as I put the breaking at the save function, control doesn't enter the function. The changed data is reflected in the html but not in the firebase database.
$scope.editFormSubmit = function(){ console.log("Updating record"); //Get ID var id = $scope.id; console.log(id); //Get Record var rec = $scope.records.$getRecord(id); console.log(rec); //Assign Values rec.fname = $scope.fname; rec.lname = $scope.lname; rec.mname = $scope.mname; rec.email = $scope.email; rec.company = $scope.company; rec.phone = $scope.phone; rec.city = $scope.city; rec.state = $scope.state; rec.zipCode = $scope.zipCode; rec.conId = $scope.conId; rec.DCN = $scope.DCN; rec.jobTitle = $scope.jobTitle; rec.pAddress = $scope.pAddress; rec.country = $scope.country; rec.name = $scope.name; // Save Record console.log("After assigning values"); console.log(rec); $scope.records.$save(rec).then(function(){ console.log("Updating values"); }); clearFields(); //hide the edit form $scope.editFormShow = false; $scope.msg = "Contact Update"; }