Why and When to Use the Ajax Services

Ajax is the foundation of the modern web application, and you will use the services that I describe in this chapter every time that you need to communicate with a server without causing the browser to load new content and, in doing so, dump your AngularJS application.

That said, if you are consuming data from a RESTful API, then you should use the $resource service. I describe REST and $resource in Chapter 21, but the short version is that $resource provides a higher-level API that is built on the services I describe in this chapter and makes it easier to perform common data operations.

Source: Freeman Adam (2014), Pro AngularJS (Expert’s Voice in Web Development), Apress; 1st ed. edition.

Leave a Reply

Your email address will not be published. Required fields are marked *