“Cómo instalar Font Awesome en Angular” Código de respuesta

fuente impresionante 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

Cómo instalar Font Awesome en 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

Agregar fuente impresionante a angular

<!--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

Cómo usar los iconos de FontawSoem descargados en 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

Respuestas similares a “Cómo instalar Font Awesome en Angular”

Preguntas similares a “Cómo instalar Font Awesome en Angular”

Más respuestas relacionadas con “Cómo instalar Font Awesome en Angular” en JavaScript

Explore las respuestas de código populares por idioma

Explorar otros lenguajes de código