问题
I installed it according to the instructions. First I've typed
npm install --save font-awesome angular-font-awesome
And it installed everything correctly. Then I changed in .angular-cli.json
to contain the css like so:
"styles": [
"styles.css",
"../node_modules/font-awesome/css/font-awesome.min.css"
],
And when I type this in the html: <span class="fas fa-chevron-left"></span>
It does not show anything at all for it.
I don't have errors either but in sources I can't find anything related to font awesome.
回答1:
<i class="fa fa-chevron-left"></i>
Use this it will help you
回答2:
This may not be the correct fix, but i had to use this in index.html
to get the icons working.
<link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" />
According to the documentation in npm
, the above link is needed only if you are NOT using angular-cli
来源:https://stackoverflow.com/questions/49574228/font-awesome-icons-not-showing-up-in-angular-5