TutorialLesson 12Free preview
AngularJS Http
This lesson is part of AngularJS · All levels
Summary
Service $http uses AngularJS to communicate with servers, both GET and POST. Because AngularJS follows a promise pattern, responses are handled in the success/error (former) or .then/.catch (modern application) blocks. When receiving server data, the response is usually placed on $scope to keep the display updated.
Key points
- $http.get and $http.post are the most common methods
- Respons are promises and dealt with with .then and .catch
- The response data is usually stored in $scope for updated display
- Note the JSON data form returned by the server
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.