1.

How To Make An Ajax Call Using Angular Js?

Answer»

AngularJS provides $HTTP control which works as a service to make ajax CALL to read DATA from the server. The server makes a database call to get the desired records. AngularJS needs data in JSON format. Once the data is ready, $http can be used to get the data from server in the following manner:
function studentController($scope, $http) {
VAR url = “data.txt”;
$http.get(url).success( function(response) {
$scope.students = response; 
});
}

AngularJS provides $http control which works as a service to make ajax call to read data from the server. The server makes a database call to get the desired records. AngularJS needs data in JSON format. Once the data is ready, $http can be used to get the data from server in the following manner:
function studentController($scope, $http) {
var url = “data.txt”;
$http.get(url).success( function(response) {
$scope.students = response; 
});
}



Discussion

No Comment Found