I started the NG2 application and want to add a font amazingly. I npm installed it with: npm install --save font-awesome angular2 -font-awesome. I added a project to systemjs.config.js:
map: { // our app is within the app folder app: 'app', // angular bundles '@angular/core': 'npm:@angular/core/bundles/core.umd.js', '@angular/common': 'npm:@angular/common/bundles/common.umd.js', '@angular/compiler': 'npm:@angular/compiler/bundles/compiler.umd.js', '@angular/platform-browser': 'npm:@angular/platform-browser/bundles/platform-browser.umd.js', '@angular/platform-browser-dynamic': 'npm:@angular/platform-browser-dynamic/bundles/platform-browser-dynamic.umd.js', '@angular/http': 'npm:@angular/http/bundles/http.umd.js', '@angular/router': 'npm:@angular/router/bundles/router.umd.js', '@angular/forms': 'npm:@angular/forms/bundles/forms.umd.js', // other libraries 'rxjs': 'npm:rxjs', 'angular-in-memory-web-api': 'npm:angular-in-memory-web-api/bundles/in-memory-web-api.umd.js', 'angular2-fontawesome': 'node_modules/angular2-fontawesome' }, // packages tells the System loader how to load when no filename and/or no extension packages: { app: { defaultExtension: 'js' }, rxjs: { defaultExtension: 'js' }, 'angular2-fontawesome': { defaultExtension: 'js' } }
and I added in app.module.ts:
import { NgModule } from '@angular/core'; import { BrowserModule } from '@angular/platform-browser'; import { AppComponent } from './app.component'; import { CorporateComponent } from './corporate/corporate.component'; import { Angular2FontawesomeModule } from 'angular2-fontawesome/angular2-fontawesome' @NgModule({ imports: [ BrowserModule , Angular2FontawesomeModule], declarations: [ AppComponent, CorporateComponent ], bootstrap: [ AppComponent ] }) export class AppModule { }
Now I am trying to use it in my component: I am adding html to the template:
<i class="fa fa-industry" aria-hidden="true"></i>
But for some reason I donβt see it ... I followed the npm guide: https://www.npmjs.com/package/angular2-fontawesome
Is there anything else I could forget?
Thanks for any answer!
source share