angular-restmod
angular-restmod copied to clipboard
Add $specialize method
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...