Great article. One thing I wish got more coverage is testing directives: it's already much easier than most DOM-testing methods (though it can't replace selenium etc.), but doing it well and consistently has proven difficult and I don't test most of my directives. For example, I had to modify the triggerHandler function in Angular to allow sending fake key presses since it didn't have a built in way (at least a few months ago) to specify the "which" property on the event.
Client side testable code is one of the pinnacle of AngularJS.
Reuseable declarative UI's through Directives, reuseable business logic throug Services and view models (controllers) having only knowledge of views is a really good for maintainablity of a complex javascript app. AngualrJS can beat any framework out there (Backbone, Ember, etc.) when it comes to having testable & manageable code.
If your product is going to be complex, AngularJS is a no-brainer deal.
Would you mind clarifying on how AngularJS is better than BackboneJS when it comes to having testable & manageable code? I am currently working setting up a unit testing environment with BackboneJS, it seems to be working well. What major differences exist when you test the two?
I believe that writing testable Javascript has been possible since the name Javascript was invented. Angular.js has made it easier by doing its best to force you to write testable code.
Generally speaking, you'd use Angular with a backend framework.
Angular and other front-end frameworks are great for responding to user interactions extremely quickly, because often you don't have to go back to the server. And in addition when it does need to interact with the server, it is often faster to respond because it doesn't need to fetch anything but JSON data.
But that data needs to come from somewhere. And that's where Rails/Django/Play/Symphony/whatever are used.
AngularJS is a javascript front-end framework, it has little to do with the server, you still need Rails,Django,Spring or whatever to manage your server-side application.
It's not "this or that". AngularJS is a complementary framework for client side instead of server side.
That said, AngularJS can offload a lot of server side work. Mainly rendering views and the overall presentation layer. You can basically ditch your server side templating system and make your Rails, Django, PHP or node.js a simple REST API endpoint (with some additional auth system based on cookies or smth).
It's built on top of WebDriverJS. I've been playing with it today and so far it's working very well.