ng-backbone

Take advantage of Backbone Model and Collection in AngularJS

View on Github Check it out on Bower

What is ng-backbone?

ng-backbone, at it's core, is nothing more than a thin layer that allows Backbone Models and Collections to be picked up by AngularJS' digest cycle. This can easily be done because both Backbone and AngularJS use jQuery's ajax method. This makes the integration really simple.

Replace Backbone.$.ajax with $http and your essentially done. See http://backbonejs.org/docs/backbone.html#section-154 for more information.

Why use ng-backbone?

When you need more control over your Model layer. Simple right?

As we developed enterprise level appplications, we saw the need to have a more organized structure than what AngularJS provided. Backbone's integration allows for the encapsulation of api integration and business logic, that is more extensive than the simple $http request, without being overkill.

Features:

How to use this

  1. Download ng-backbone from Github directly or Bower:
    bower install ng-backbone
  2. Add ngBackbone module to your AngularJS application
    angular.module('MyApp', ['ngBackbone']);
  3. Create custom model and collection by extending NgBackboneModel and NgBackboneCollection
    var Sample = NgBackboneModel.extend({});
    var SampleCollection = NgBackboneCollection.extend({});

Example

More Information