javascript - How to override default functionality in Ember-addons -
in ember-cli documentation describes bridging addon within host application overriding app/component/[addon-name.js] yourself. however, documentation doesn't explicitly state how this.
with trial , error i've noticed creating component file in [host app]/app/component/[name of addon.js] , copy/paste addon code there provides venue customize addon. however, terrible approach, imagine override functions in question...and in cases call this.super().functionname in order keep over-rides simple , trim.
however, can't work. ideas?
extensibility why addons have both addon/
, app/
trees. in app
tree component, component should import , export, example:
import xselect 'emberx-select/components/x-select'; export default xselect;
source: https://github.com/thefrontside/emberx-select/blob/master/app/components/x-select.js
in kind of case want create component in [host app]/app/component/[name-of-addons-component.js]
in component do:
import xselect 'emberx-select/components/x-select'; export default xselect.extend({ //any overrides });
Comments
Post a Comment