Skip to content

Instantly share code, notes, and snippets.

@mwagena
Last active June 17, 2019 09:58
Show Gist options
  • Save mwagena/c2672a3f79ec263f72cfe98a8ef1eda8 to your computer and use it in GitHub Desktop.
Save mwagena/c2672a3f79ec263f72cfe98a8ef1eda8 to your computer and use it in GitHub Desktop.
Make use of Ionicon Web components in Angular

npm install ionicons

add the code below to "assets" in the angular.json file.

{
   "glob": "**/*",
   "input": "./node_modules/ionicons/dist/ionicons/",
   "output": "./ionicons/"
}

add the import below to "scripts" in the angular.json file.

"./node_modules/ionicons/dist/ionicons.js"

We’ve started by importing CUSTOM_ELEMENTS_SCHEMA from @angular/core and added it to the application’s @NgModuledeclaration in the schemas property.

You can now use ionicons as you would expect: <ion-icon name="heart"></ion-icon>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment