You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
...
app.import('node_modules/feather-icons/dist/feather.js',{using: [{transformation: 'cjs',as: 'feather'}// <-- enables `import 'feather'` from anywhere in the application]});
In my case, I call feather.replace() from within a component's javascript file:
// app/components/home.jsimportComponentfrom'@ember/component';importfeatherfrom'feather';// <-- using the transform nameexportdefaultComponent.extend({feather: feather,// <-- heredidInsertElement(){this.feather.replace();// <-- replaces all references to data-feather with the correct SVGs}});
In the corresponding component template file I simply add the data-feather tag to the elements I want to replace with an icon:
<!-- app/templates/components/home.hbs -->
<spandata-feather="home"></span> Home
Done.
The text was updated successfully, but these errors were encountered:
Getting Feather to work with Ember is quite simple. I think the README could be updated to include how to use icons with the framework.
Here are the steps I followed:
Feather
ember-cli-build.js
feather.replace()
from within a component's javascript file:data-feather
tag to the elements I want to replace with an icon:Done.
The text was updated successfully, but these errors were encountered: