To install the font-awesome, we have to follow certain step
- npm install –save font-awesome
- Open index.html of root folder, add following code in <head>
- Adding a custom copy script, Copy the file copy.config.js file and past in new location config in the root folder. Ionic includes a copy script file that is called during the build process when you run
and it’s responsible for moving certain resources from tonode_modules
the www folder,
- Rename the copy.config.ts to copy-custom-libs.js: append the following code along with existing code at the end.
- Last but not least, we need to instruct Ionic that we want to use our new copy script as opposed to the one that is included already. For that, we need to open our package.JSON file and add the following section We can restart our apps, we can use font-awesome in our apps.
How to add a font in Ionic Apps:
In this example, we will take a font from Google fonts. Create a folder called fonts in the assets folder and save the font with formats woff2. In app folder, we have file app.scss and add the following code in app.scss