font awesome with Angular 2

前端 未结 4 1069
一整个雨季
一整个雨季 2020-12-19 09:42

I started an NG2 app and wanna add font awesome. I npm installed it with : npm install --save font-awesome angular2-font-awesome. I added to project in systemjs.config.js:

4条回答
  •  执念已碎
    2020-12-19 10:26

    Try to use this method:

    Firstly install font awesome using command : npm install --save font-awesome angular-font-awesome

    secondly, import it in your style.scss file with

    $fa-font-path: "../node_modules/font-awesome/fonts";
    @import "../node_modules/font-awesome/scss/font-awesome.scss";
    

    or to your style.css file with

    @import '~font-awesome/css/font-awesome.css';
    

    command. The fonts are ready to use.

    Now place your font in any html file.

提交回复
热议问题