The Lapidary Lemur

Musings from Brandon Weaver

Reveling in REST

Services are always the last thing anyone mentions in conjunction with Angular, despite being the single most important part. It rather well kills the point of having a frontend framework if you can’t even get data properly from your respective backend. Great! Now that we have that out of the way, let’s dive right into how to implement a RESTful client in Angular to get you up on your data in high fashion!

…except if you’ve already tried, you noticed quite the disconcerting truth. Angular is Javascript, and like its kin it has as many implementations of REST as there are people who are capable of making one. A few might chuckle to themselves on the fulfillment of the LISP curse, but fret not! There is hope yet, or at very least someone with enough patience to lay out a few options worth looking into so you don’t have to.

The Frivolous Frontend Framework

Many a hardened Rails programmer will swear by their ERB or HAML, shaking a fist at the sky decrying the acolytes from the land of Javascript for their frivolous frontend frameworks.

“Who needs them!” they say haughtily. “jQuery has sustained us perfectly fine, and our applications are not nearly large enough to warrant the extra overhead! Why would any of us use a frontend framework?”

Yet there are those of us, standing upon the hill, pilgrims from the unholy land of Ajax Callbacks and Asynchronous Updates, looking upon them with something akin to pity.

Many Woes With Many to Many Relations

Rails provides us with a lot of power in routing and associations, but if you’ve ever tried to set up an API with any form of many-to-many relationship, you’re in for a nightmare. Google won’t save you, the Rails guides are sparse, and there’s a grand total of one good blog post on the matter from a few years ago.