Sign in through GitHub

Please read for an updated status on RailsCasts:

Learn more or hide this

Jon Jaques's Profile

GitHub User: jonjaques

Site: http://jonjaques.com

Comments by Jon Jaques

Avatar

Angular and Backbone differ in a few ways. Backbone is more of a low-level library, where much of the implementation is up to the developer. Angular is a much more opinionated (like Rails) framework, and does a lot more for you out of the box. The big difference though is the data-binding.

Standard BB applications usually involve stamping out templates, and reacting to changes on the model is very much a manual process. Of course there are plugins to simplify this like Derick Bailey's backbone.modelbinding.

With angular, the emphasis is on enhancing HTML through directives - which allow you to bind your data (javascript objects and such) to the DOM. This is an immensely powerful concept, because you don't have to deal with listening for events or do DOM traversal. In turn, you can move much of your view logic into controllers which take care of gluing together the interactions. They are somewhat analogous to view models, which should be familiar to anyone who's worked with Knockout.js.