I am working with Angular(6) application, and I am trying to use FA icons, and drop-down with no luck. I am successfully using FA(4) icons, like:
For Font Awesome 4.7.0:
It should work by simply doing:
npm install font-awesome --save
And adding:
@import "~font-awesome/css/font-awesome.css";
...to your styles.css
or styles.scss
.
For Font Awesome 5 use the official Font Awesome 5 angular component
npm add @fortawesome/fontawesome-svg-core
npm add @fortawesome/free-solid-svg-icons
npm add @fortawesome/angular-fontawesome
In your template:
In your typescript:
import { faAlignJustify } from '@fortawesome/free-solid-svg-icons';
export class MyComponent {
faAlignJustify = faAlignJustify;
}
In the module of your component:
import { FontAwesomeModule } from '@fortawesome/angular-fontawesome';
@NgModule({
declarations: [
MyComponent
],
imports: [
BrowserModule,
FontAwesomeModule
]
})
export class MyModule { }