This question was asked, and he answered, 18 months ago. Recently, I went through the same issue on the project. I wanted to have a basic model that I could use to create factories. Angular has a very simple provider that can help with this Value Provider , which Angular implements using Recipe Values .
I'm not sure which version of Angular you could use at that time, but it dates back (AFAIK) to version 1.3.0. (At the time of writing, the current one is stable - 1.4.8)
I also use John Resig Simple Inheritance Script. http://ejohn.org/blog/simple-javascript-inheritance/
Here is a snippet of my code (with the removal of most of the specific application logic).
var MyApp = angular.module( 'MyApp',['ngResource','ngAnimate','ngSanitize'] ); /* ==================================================================================== */ // - Base Model Class ------------------------------------------------------------- /* ==================================================================================== */ MyApp /** * BaseModel - Value Provider * */ .value( 'BaseModel',Class.extend({ attribs: {}, init: function(){ var self = this; _active = true; _new = true; _origs = {}; _loadByObject = function( obj ){ ... } }, get: function( key ){ ... }, set: function( key,val ){ ... }, isNew: function(){ ... }, keep: function(){ ... }, remove: function(){ ... }, load: function( obj ){ ... } verify: function(){ ... }, save: function(){ ... }, })) .factory( 'UserFactory', [ '$http', '$q', 'BaseModel', function( $http, $q, BaseModel ){ var UserFactory = BaseModel.extend({ init: function(){ this._super( false ); _fields = [ 'first', 'last', 'email', 'phone', 'password', 'role' ]; _permitted = [ 'first', 'last', 'email', 'phone', 'password', 'role' ]; _required = [ 'first', 'last', 'email', 'role' ]; _resource = "users"; _api = "users"; } }); return UserFactory; }])
I would also like to hear feedback.
Here's Angular Docs: https://code.angularjs.org/1.3.0/docs/guide/providers