I started an NG2 app and wanna add font awesome.
I npm installed it with : npm install --save font-awesome angular2-font-awesome.
I added to project in 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 try to use it in my component:
I add in the html template:
<i class="fa fa-industry" aria-hidden="true"></i>
But somehow I don't see it...
I followed the manual of npm: https://www.npmjs.com/package/angular2-fontawesome
Is there anything else that I might have forgotten ?
Thanks for any answer!
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…