AngularJS is a terrific front-end. It supports testability, clean code organization, and has a simple object model. It's supremely powerful but, of course, wasn't designed with Rails in mind—it's back-end agnostic.
This mini-book is going to change that. We're going to see step-by-step instructions for building a Rails app with Angular, and getting it deployed to production. That means we'll properly configure the asset pipeline, provide a solution for managing front-end assets, and see how to integrate testing the front-end code into your app.
This is not a Rails or Angular tutorial. If you'd like to learn Angular, I would suggest completing their tutorial. Don't just read it, type out the code. Run the code. Tweak the code. It only takes an hour or so, and it'll give the confidence you need to start using Angular (that's what I did).
Once you're familiar enough with Angular to start building an app, you'll find there are a lot of unanswered questions:
I was able to find answers by piecing together information from Stack Overflow and various blog posts. You shouldn't have to do that.
This mini-book is broken up into four major parts:
The technologies we'll be using:
When we're done, you'll know exactly what you need to do to get Angular into your Rails app in a way that supports sustained development and deployment. You'll be able to get to your code more quickly and confidently.
The code in this book is pulled from a git repository containing the Rails app we'll be building. The console output we'll see is generated directly from that code, so you should be able to follow along easily.
I'd still recommend you follow along at your terminal and editor. Even though you will just be typing in what you see, it'll get your fingers used to the workflow and code involved in a a Rails-powered Angular app.
All you'll need:
The app we'll see in this book was originally developed on OS X, so some terminal commands might be different if you are on Windows. Please let me know what those differences are.
With that out of the way, let's get started!