WHAT YOU WILL LEARN IN THIS CHAPTER:
- What promises are and why they’re useful
- How to make AJAX calls using $http
- Error handling using HTTP interceptors
- How to consume APIs using $resource
- RESTful API best practices using StrongLoop LoopBack
- Integrating AngularJS with web sockets
- Real-time chat example using Firebase
WROX.COM CODE DOWNLOADS FOR THIS CHAPTER
You can find the wrox.com code downloads for this chapter at
http://www.wrox.com/go/proangularjs on the Download Code tab.
WHY WILL I LEARN?
Most modern web applications need to communicate with a server. Whether you’re loading data from a public REST application programming interface (API) or sending data to your server for storage, server communication is the way your application acquires and persists data. In this chapter, you discover the mechanisms that AngularJS provides for loading data from APIs. You are exposed to basic best practices of RESTful APIs and generate a simple NodeJS back-end API server using StrongLoop’s LoopBack framework. You also learn about AngularJS Hypertext Transfer Protocol (HTTP) interceptors, a powerful abstraction for handling errors. Finally, you will discover two mechanisms for using AngularJS to build real-time applications: web sockets and Google’s Firebase framework.