Take advantage of Backbone Model and Collection in AngularJS
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.
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.
bower install ng-backbone
ngBackbone
module to your AngularJS application
angular.module('MyApp', ['ngBackbone']);
NgBackboneModel
and NgBackboneCollection
var Sample = NgBackboneModel.extend({});
var SampleCollection = NgBackboneCollection.extend({});