In the ember-cli documentation it describes bridging the addon within your host application by overriding the app/ponent/[addon-name.js] yourself. However, the documentation doesn't explicitly state how to do this.
With trial and error I've noticed that by creating a ponent file in your [host app]/app/ponent/[name of addon.js] and simply copy/paste the addon code into there provides a venue to customize the addon. However, this is a terrible approach, I would imagine that I could simply override the functions in question...and in some cases call this.super().functionName in order to keep the over-rides simple and trim.
However, I can't get this to work. Any ideas?
In the ember-cli documentation it describes bridging the addon within your host application by overriding the app/ponent/[addon-name.js] yourself. However, the documentation doesn't explicitly state how to do this.
With trial and error I've noticed that by creating a ponent file in your [host app]/app/ponent/[name of addon.js] and simply copy/paste the addon code into there provides a venue to customize the addon. However, this is a terrible approach, I would imagine that I could simply override the functions in question...and in some cases call this.super().functionName in order to keep the over-rides simple and trim.
However, I can't get this to work. Any ideas?
Share Improve this question asked Apr 14, 2015 at 18:34 samsam 7631 gold badge7 silver badges15 bronze badges1 Answer
Reset to default 8Extensibility is why addons have both the addon/
and app/
trees. In the app
tree for a ponent, the ponent should just be an import and export, for example:
import XSelect from 'emberx-select/ponents/x-select';
export default XSelect;
Source: https://github./thefrontside/emberx-select/blob/master/app/ponents/x-select.js
In this kind of case you want to create the ponent in [host app]/app/ponent/[name-of-addons-ponent.js]
then in that ponent do:
import XSelect from 'emberx-select/ponents/x-select';
export default XSelect.extend({
//any overrides
});
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744996427a4605219.html
评论列表(0条)