I’m looking to learn angularjs, based on the recommendation of an acquaintance. I’ve read a fair bit about it, particularly from the angularjs home page. It looks like a very powerful way to build a single-page web app, and has a bunch of benefits. It also seems to have impenetrable documentation, and to be a little immature still. Finally, the integration with rails is less than clear.
So, a challenge then. Over the next wee while, I’ll be spending some of my free time trying to make something sensible out of this. The first decision I’m making is how I’m going to tie rails and angularjs together, at least for the sample application.
I’ve looked backwards and forwards, and my conclusion is to entirely separate the two. I’m going to have a rails application that purely serves up json, and offers no html client. And then I’m going to have a standalone angular application that uses that rails app as a backend.
My logic here has a few parts:
- Both angular and rails have scaffold generators, test frameworks etc. These frameworks don’t look like they’re going to play together all that well in a single directory structure – they look like I’ll end up with lots of conflicts
- All the recommendations are to test your angular app using stubs in the first instance, then integration test it with your server. Separating the two seems to have more potential for doing that
So, that’s my aim. We’ll see how we go.