userimage

How to make an ajax call using Angular.js?

How to make an ajax call using Angular.js?
userimage
Angular.js provides $http control which works as a service to make ajax call to read data from the server. 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 serverController($scope, $http) {
   var url = "controllerURL.htm";
   $http.get(url).success( function(response) {
      $scope.students = response;
   });
}
Answer is