javascript - Ember computed property _super -
i'd know if there way _super
computed property?
for example:
controllers/core-controller.js
export default controller.extend({ myattribute: computed(function() { return { bar: this.get('bar') }; }); });
controllers/my-controller.js
import corecontroller 'controllers/core-controller'; export default corecontroller.extend({ myattribute: computed(function() { let super = this.get('_super') //i'm trying myattribute object corecontroller return merge(super, { foo: 'foo' }); }); });
what best way that?
thanks.
you can calling this._super(...arguments)
:
import corecontroller 'controllers/core-controller'; export default corecontroller.extend({ myattribute: computed(function() { let supervalue = this._super(...arguments); return merge(supervalue, { foo: 'foo' }); }); });
also demoed in twiddle: https://ember-twiddle.com/dba33b9fca4c9635edb0
Comments
Post a Comment