“So installieren Sie die Schriftart fantastisch in Angular” Code-Antworten

Schriftart fantastischer Angular

//install in your project directory
npm install --save @fortawesome/fontawesome-free

// in angular.json add in the 'build' section the following lines in 'styles' and 'scripts'
"styles": [
           "node_modules/@fortawesome/fontawesome-free/css/all.css"
        ]

"scripts": [
          "node_modules/@fortawesome/fontawesome-free/js/all.js"
        ]

//from now on, you can use fontawesome icons through the <i>
    <i class='fab fa-facebook'></i>
Grieving Gharial

So installieren Sie die Schriftart fantastisch in Angular

// 1. "npm install font-awesome --save"
// 2. In the angular-cli.json file locate the styles[] array and add font-awesome references directory here, like below:
"apps": [
    {
      "root": "src",
      "outDir": "dist",
      ....
      "styles": [
          "styles.css",
          "../node_modules/bootstrap/dist/css/bootstrap.css",
          "../node_modules/font-awesome/css/font-awesome.css" // -here webpack will automatically build a link css element out of this!?
      ],
      ...
  }
  ]
],
// 3. Place some font-awesome icons in any html file you want:  
  <i class="fa fa-american-sign-language-interpreting fa-5x" aria-hidden="true"> </i>
// 4. Stop the application Ctrl + c then re-run the app using ng serve because the watchers are only for the src folder and angular-cli.json is not observed for changes.
// 5. Enjoy your awesome icons!
Fancy Flatworm

Fügen Sie eine Schriftart fantastisch zu Angular hinzu

<!--In the index.html-->
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.2.0/css/all.css" integrity="sha384-hWVjflwFxL6sNzntih27bfxkr27PmbbK/iSvJ+a4+0owXq79v+lsFkW54bOGbiDQ" crossorigin="anonymous">
MitchAloha

So verwenden Sie die heruntergeladenen Fontawsoem -Symbole in Angula

"apps": [
    {
      "root": "src",
      "outDir": "dist",
      ....
      "styles": [
          "styles.css",
          "../node_modules/bootstrap/dist/css/bootstrap.css",
          "../node_modules/font-awesome/css/font-awesome.css" // -here webpack will automatically build a link css element out of this!?
      ],
      ...
  }
  ]
],
Dark Dolphin

Ähnliche Antworten wie “So installieren Sie die Schriftart fantastisch in Angular”

Fragen ähnlich wie “So installieren Sie die Schriftart fantastisch in Angular”

Weitere verwandte Antworten zu “So installieren Sie die Schriftart fantastisch in Angular” auf JavaScript

Durchsuchen Sie beliebte Code-Antworten nach Sprache

Durchsuchen Sie andere Codesprachen