angular-restmod icon indicating copy to clipboard operation
angular-restmod copied to clipboard

Add $specialize method

Open iobaixas opened this issue 11 years ago • 0 comments

The $specialize method will create a new collection/instance with the same scope as the calling object but with an extended type:

var newModel  = Model.$specialize('PagedModel', 'CachedModel');
var newCollection  = collection.$specialize('PagedModel', 'CachedModel'); // preserves scope and parameters
var newInstance  = object.$specialize('PagedModel', 'CachedModel'); // preserves scope and pk

Im not really sure on the behaviour for the last case (instance), i think that the public key should be also preserved...

iobaixas avatar Jan 26 '14 22:01 iobaixas