Skip to content

Instantly share code, notes, and snippets.

@DrMabuse23
Created September 23, 2015 11:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DrMabuse23/9b5f0686bbba07b076f2 to your computer and use it in GitHub Desktop.
Save DrMabuse23/9b5f0686bbba07b076f2 to your computer and use it in GitHub Desktop.
'use strict';
/**
* @ngdoc service
* @name sync:TangaCollectionService
* @description add your description
*/
angular.module('tanga')
.service('TangaCollectionService', function TangaCollectionService(Backbone, _) {
var self = this;
this.options = {
parse: function (resp) {
return resp.data;
}
};
/**
* @ngdoc method
* @name getCollection
* @description return a Backbone Collection
* @methodOf sync:TangaCollectionService
*/
this.getCollection = function (options) {
var Entity = Backbone.Collection.extend(_.extend(self.options, options));
return new Entity();
};
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment