.controller("selectStudentController",function($scope,$http){
$scope.showStudents = function(){
$http.post("selectStudent.php").then(function(response){
$scope.studentData = response.data;
})
}
})
.controller("saveStudentController",function($scope,$http){
$scope.saveIt = function(){
$http.post("saveNewStudent.php", {"sName" : $scope.sName,
"gender" : $scope.gender,
"salary" : $scope.salary,
"dob" : $scope.dob}
).then(function(response){
alert("Record Saved Successfully...");
$scope.showStudents();
})
}
})
Hi, this is my code. Here, when i call $scope.showStudents(); is not working after Record Saved Successfully... message. Can anybody tell me what is the mistake in it. My record saved and select fine but i unable to call this function.
$scope, putting obsolete quotes around object property names, usingalertfor debugging and having all controllers chained in one file. But the biggest mistake is asking question on stackoverflow before you understand your own code and calling itfunction not workingwhich is describing 99% of programming problems