O'Reilly logo

AngularJS: Novice to Ninja by Sandeep Panda

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 8Interacting with REST APIs

Up to this point in our project, we've been storing all the blog posts in a custom service. But in a real-world app, you'll need to store your data in persistent storage: your server will normally expose a REST API, which will enable you to perform CRUD operations on your app. In AngularJS, we interact with these REST APIs using services such as $http and $resource. But before you do this, you need to be aware of a concept called promises. This chapter will first introduce the concept of promises and then explain how to work with REST APIs using $http and $resource.

In the next chapter we'll revamp our demo app to use a REST back-end to store our blog posts. We'll also see how to unit test controllers that ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required