Ember defines object properties through Ember.defineProperty . Signature Ember.defineProperty(object, propertyName, function) . For example, to define the lorem property supported by _lorem , you can use
Ember.defineProperty(this, 'lorem', Ember.computed(function (key, value) { if (value) { this.set('_lorem', value); return value; } else { return this.get('_lorem'); } } ));
You can call this method based on a user input handler when propertyName is dynamic. Such a thing is best suited for expanding the Meta object system. Caution is recommended, especially when entering a user!
source share