8

Use Font Awesome with Angular

 3 years ago
source link: https://marco.dev/2017/07/16/font-awesome-angular/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Install the Font Awesome npm package

npm install font-awesome --save

In the .angular-cli.json file you have to add the reference to the font-awesome.css that you just installed:

	"styles": [
	  "styles.css",
	  "../node_modules/bootstrap/dist/css/bootstrap.min.css",
	  "../node_modules/font-awesome/css/font-awesome.css"
	],

In your pages you can reference the icons, e.g.:

<a href="https://twitter.com/marcomolteni" target="_blank"><i class="fa fa-twitter fa-2x menu-icon" aria-hidden="true"></i></a>

with the following result:

footer.png

Here the list of the available icons https://fontawesome.io/icons/

Author

Marco Molteni

Marco Molteni Blog


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK