Reputation: 706
How should I include libraries external to Angular? I want to include Fontawesome Pro in my project. But I do not know exactly where to put my library folder.
Upvotes: 1
Views: 471
Reputation: 706
I would like to include manually. I believe it is possible to do this in the assets in Angular, however, as I needed the fontawesome Pro, I got it here: https://fontawesome.com/how-to-use/on-the-web/setup/using-package- managers? fbclid = IwAR3ef_gIvsQsb7Kv0TIkAIJPxo-LAaltKMcsaiICpHfHXMOlPdijBSUnKDc
Upvotes: 0
Reputation: 2643
You can use npm package,
npm install --save font-awesome angular-font-awesome
Import your root module,
import { AngularFontAwesomeModule } from 'angular-font-awesome';
@NgModule({
imports: [
AngularFontAwesomeModule
]
})
export class AppModule { }
If you are using Angular CLI, you need to add it to your angular-cli.json
as other answer shown.
"styles": [
"../node_modules/font-awesome/css/font-awesome.css"
]
Documentations are here,
Upvotes: 1
Reputation: 378
you must install it with npm , for example npm i font-awesome --save
and add path to styles in angular.json file
"styles":[
"./node_modules/font-awesome/css/font-awesome.min.css",
]
Upvotes: 0