ngx-file-icons
v0.0.3
Published
An angular library to display file icons according to their extension
Downloads
786
Readme
Ngx File Icons
An angular library to display file icons according to their extension based on file-icon-vectors.
Installation
Using npm
:
$ npm install --save ngx-file-icons
Usage
- Add
FileIconsModule
toimports
inAppModule
:
import { NgModule } from "@angular/core";
import { BrowserModule } from "@angular/platform-browser";
// NGX File Icons
import { FileIconsModule } from "ngx-file-icons";
// Components
import { AppComponent } from "./app.component";
@NgModule({
imports: [BrowserModule, FileIconsModule],
declarations: [AppComponent],
bootstrap: [AppComponent],
})
export class AppModule {}
- Add
file-icon
toapp.component.html
:
<file-icon [set]="cla" [type]="pdf" [size]="xl"></file-icon>
- Define attributes in
app.component.ts
:
import { Component } from "@angular/core";
@Component({
selector: "app-root",
templateUrl: "./app.component.html",
})
export class AppComponent {
cla = "classic";
pdf = "pdf";
xl = "xl";
}