Hacker News new | past | comments | ask | show | jobs | submit login

> I'd love to read more about integrating Angular with RESTful backends.

If your backend exposes a textbook REST interface, integrating it with AngularJS is almost no work at all. $resource is all you need. In case you have one or two non-RESTful endpoints here and there – and honestly, who doesn't? – $http is your friend.

In an app I'm working on, I have a front-end built with Angular talking to a Tastypie back-end. Since Tastypie implements all the boring REST CRUD for you automagically, integrating the two took about fifteen minutes total.

If there are there any specific questions/issues on your mind, ask away.




Do you have an example of TastyPie and AngularJS working together? I've got a straight-forward CRUD app (mostly) that AngularJS will be great for, but wrapping my brain around it all and an API has been difficult.


Unfortunately, I don't know of any such examples.

Here's something I found while Googling around: https://github.com/dalcib/angular-phonecat-mongodb-rest. It doesn't use Django and Tastypie, but you may find at least the front-end code educational.

I personally completely separate my front-end and back-end code. So while the API is built with Django, the front-end doesn't go through Django at all. It's served straight through nginx without doing anything special except maybe some simple URL rewrites for prettier URLs.

If I'm not too tied up in college work this week, I might do a write up on Tastypie and Angular integration.


thats great. thanks. I'm still learning about Angular and had been using $http pretty much raw for most of the data fetching. I started to play around with $resource but didn't get very far due to some frustratingly vague documentation on the official site.

Do you know of any really good tutorials emphasizing Angular's $resource service?


> Do you know of any really good tutorials emphasizing Angular's $resource service?

Not really. I just used the official documentation. The egghead.io tutorials may touch on $resource. I also found this helpful: http://www.bennadel.com/blog/2433-Using-RESTful-Controllers-...

Some Googling turned this up: https://github.com/dalcib/angular-phonecat-mongodb-rest. It may help you.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: