Skip to content

Instantly share code, notes, and snippets.

@janmisek
Created December 14, 2018 14:39
Show Gist options
  • Save janmisek/2bc614252c520335c99be5c2c00bea3b to your computer and use it in GitHub Desktop.
Save janmisek/2bc614252c520335c99be5c2c00bea3b to your computer and use it in GitHub Desktop.
// get computed properties descriptors - eg: for clonning
const metal = Ember.__loader.require('ember-metal');
EmberObject.eachComputedProperty(key => {
const descriptor = metal.descriptorFor(Model.prototype, key);
// console.log(descriptor._getter.toString());
// now we can take descriptor._getter or descriptor._getter to create computed property on target object
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment