build: add angular font awesome

* Add angular font awesome
* Add custom shared module for icons
This commit is contained in:
Abhay Chawla
2018-08-09 03:43:34 +05:30
parent 81d6cded6a
commit bf64608805
5 changed files with 62 additions and 3 deletions
@@ -1,6 +1,7 @@
<button mat-button (click)="inputFile.click()">
<mat-icon>file_upload</mat-icon>
<fa-icon icon="file-upload" size="lg"></fa-icon>
&nbsp;&nbsp;
Upload an image
</button>
{{ filename }}
{{ filename || 'No File Uploaded' }}
<input type="file" #inputFile (change)="onFileSelected($event)" [style.display]="'none'" />
+22
View File
@@ -0,0 +1,22 @@
import { NgModule } from '@angular/core';
import { FontAwesomeModule } from '@fortawesome/angular-fontawesome';
import { library } from '@fortawesome/fontawesome-svg-core';
import {
faFileUpload,
faSearch
} from '@fortawesome/free-solid-svg-icons';
// Add an icon to the library for convenient access in other components
library.add(
faFileUpload,
faSearch
);
@NgModule({
imports: [],
declarations: [],
exports: [FontAwesomeModule]
})
export class IconsModule { }
+5 -1
View File
@@ -1,14 +1,17 @@
import { NgModule } from '@angular/core';
import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import { CommonModule } from '@angular/common';
import { LoaderComponent } from './loader/loader.component';
import { FileUploadComponent } from './file-upload/file-upload.component';
import { DeleteDialogComponent } from './delete-dialog/delete-dialog.component';
import { MaterialModule } from './material.module';
import { IconsModule } from './icons.module';
@NgModule({
imports: [
CommonModule,
IconsModule,
MaterialModule
],
declarations: [
@@ -19,6 +22,7 @@ import { MaterialModule } from './material.module';
exports: [
CommonModule,
FileUploadComponent,
IconsModule,
LoaderComponent,
MaterialModule
],