lf-angular-file-drop
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

Angular Drag and Drop file component

Drag and drop component for angular, without any dependencies.

You simply drag and drop, or click inside.

Installation

NPM

npm i lf-angular-file-drop

Implementation

Just add the DragNDropModule to your app.module.ts:

import { BrowserModule } from '@angular/platform-browser';
import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
 
import { AppComponent } from './app.component';
import { DragNDropModule } from 'drag-n-drop';
 
 
@NgModule({
  declarations: [
    AppComponent,
  ],
  imports: [
    BrowserModule,
    DragNDropModule
  ],
  providers: [],
  schemas: [CUSTOM_ELEMENTS_SCHEMA],
  bootstrap: [AppComponent]
})
export class AppModule { }
 

and use it in your html:

 
  <lf-drag-n-drop 
    multiple="true"
    labelBackground="green"
    color="white"
    (fileDropped)="handleFiles($event)">
  </lf-drag-n-drop>
 

Properties

Name Optional Description
(fileDropped) No Returns the file (s) in an event
multiple (boolean) Yes Allows you to recieve one or multiple files, this value is a boolean and false by default
labelBackground (string) Yes Changes the label background color
color (string) Yes Changes the label font color

Examples

 
  <lf-drag-n-drop 
    multiple="true"
    labelBackground="green"
    color="white"
    (fileDropped)="handleFiles($event)">
  </lf-drag-n-drop>
 

 
  <lf-drag-n-drop 
    labelBackground="white"
    color="purple"
    (fileDropped)="handleFiles($event)">
  </lf-drag-n-drop>
 

Package Sidebar

Install

npm i lf-angular-file-drop

Weekly Downloads

0

Version

1.0.1

License

none

Unpacked Size

154 kB

Total Files

30

Last publish

Collaborators

  • luis_hdez87