AngularJS Developer Question:
Download Questions PDF

Explain me how to make an ajax call using Angular JS?

Answer:

AngularJS provides $https: 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, $https: can be used to get the data from server in the following manner:

function studentController($scope,$https:) {
var url = "data.txt";
$https:.get(url).success( function(response) {
$scope.students = response;
});
}

Download AngularJS Developer Interview Questions And Answers PDF

Previous QuestionNext Question
Tell me how to implement internationalization in AngularJS?What is ng-controller directive?