Skip to content

Instantly share code, notes, and snippets.

@ghempton
Created August 4, 2014 16:07
Show Gist options
  • Save ghempton/be43107bf626284df9dc to your computer and use it in GitHub Desktop.
Save ghempton/be43107bf626284df9dc to your computer and use it in GitHub Desktop.
/**
Attempting to create a subclass of `Model` that supports
CP's and Ember.Observable.
*/
function EmberModel() {
Model.apply(this, arguments);
return CoreObject.apply(this);
}
var PrototypeMixin = Model.prototype;
CoreObject.PrototypeMixin.apply(PrototypeMixin);
PrototypeMixin.ownerConstructor = EmberModel;
EmberModel.PrototypeMixin = PrototypeMixin;
var ClassMixin = Model;
CoreObject.ClassMixin.apply(ClassMixin);
ClassMixin.ownerConstructor = EmberModel;
ClassMixin.apply(EmberModel);
EmberModel.ClassMixin = ClassMixin;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment