O'Reilly logo

Learning Web Development with Bootstrap and AngularJS by Stephen Radford

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

Connecting with ngResource

Low-level connection helpers like $http are great for single connections, but they quickly become cumbersome when managing a full project. Thankfully, Angular has another way we can access data on the server side in the form of an optional module called ngResource.

Including ngResource

Just like ngRoute, the ngResource module can be found under the Extras link in the download modal at https://angularjs.org/. Download it and drag it into your project's js directory. You then need to include it after Angular in the root HTML file:

<script type=""text/javascript"" src="/assets/js/angular-resource.min.js"></script>

Lastly, ensure that the contactsMgr module knows that the ngResource module is a dependency:

angular.module('contactsMgr', ...

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