Quantcast
Channel: Rowboat Web » AngularJS
Viewing all articles
Browse latest Browse all 8

Restangular and AngularJS

$
0
0

My last few posts have been all about WebGL, but I wanted to switch back to AngularJS to try out the Restangular service. It’s supposed to make it easier for you to manage RESTful resources in your AngularJS project. AngularJS already has a $resource service that’s supposed to offer a level of abstraction on top of $http for working with RESTful APIs, but there is clearly at least one dev that found the implementation of the $resource service lacking. So now we have Restangular. I really don’t have a lot of experience working with the $resource service provided with AngularJS. I may have used it once or twice in one of the first projects I built using AngularJS, but for the most part I’ve been using the $http service to make requests.

Before I jump into installing and using Restangular, I wanna take a quick detour and talk about running your AngularJS apps and your API locally for development purposes. I’m using Yeoman to generate and run my AngularJS apps, and I’ll be using it to run the demo application as well. Of course, you’ll quickly find out that your browser will refuse to make an XHR to a different origin, which means that your browser won’t allow your AngularJS app running locally on port 9000 to make requests to your API running locally on port 80. So how do we get around this restriction? I’ll go into more detail in tomorrow’s post.


Viewing all articles
Browse latest Browse all 8

Latest Images

Trending Articles





Latest Images