1.0.2 • Published 2 years ago

ngx-reactive-file-input v1.0.2

Weekly downloads
-
License
-
Repository
github
Last release
2 years ago

Overview

NGX Reactive File Input is a simple and Lightweight component which helps to use input file with forms (reactive or template driven) with native file input attributes support (id, class, accept, etc...)

DEMO

check the DEMO

Installation

npm i --save ngx-reactive-file-input

Usage

Importing The 'ngx-reactive-file-input' Module

import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { HttpClientModule } from '@angular/common/http';

import { AppComponent } from './app.component';
import { NgxReactiveFileInputModule } from 'ngx-reactive-file-input';


@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    BrowserModule,
    FormsModule,
    NgxReactiveFileInputModule
  ],
  providers: [],
  bootstrap: [AppComponent]
})
export class AppModule { }

In Component HTML

<ngx-reactive-file-input formControlName="file" (fileChanged)="files = $event"></ngx-reactive-file-input>

You can use any input file type attributes such as accept, id, class, etc...

example

<form>
    <ngx-reactive-file-input accept="images/*" class="input__file" id="attachment"></ngx-reactive-file-input>
</form>

Parameters

NameDescriptionExample
(fileChanged)get input files change(fileChanged)="handleFiles($event)"

License

MIT

Change Log

CHANGELOG

1.0.2

2 years ago

1.0.1

2 years ago

0.0.1

2 years ago