# angular-file-drag-drop

> Simple multiple files drag and drop component in Angular 7, also allows to select multiple files using button given. Gives selected files array as output.

Latest version **0.0.12** (published 2019-04-04) · ISC license · 0 weekly downloads

## Install

```sh
npm install angular-file-drag-drop
pnpm add angular-file-drag-drop
yarn add angular-file-drag-drop
bun add angular-file-drag-drop
```

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.12 |
| Published | 2019-04-04 |
| First published | 2019-04-04 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 255.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Kokila |
| Maintainers | kokila-bawankar |
| Keywords | Angular7, Angular6, Angular5, Angular4, Angular2, File Drag Drop |

## Links

- npm: https://www.npmjs.com/package/angular-file-drag-drop
- Repository: https://github.com/KokilaBawankar/angular-file-drag-drop
- Homepage: https://github.com/KokilaBawankar/angular-file-drag-drop#readme
- Issues: https://github.com/KokilaBawankar/angular-file-drag-drop/issues
- npm.io page: https://npm.io/package/angular-file-drag-drop

## Dependencies (1)

- [tslib](https://npm.io/package/tslib.md) ^1.9.0

## Recent versions

- 0.0.12 (latest) — 2019-04-04

## README

Angular file drag drop is simple multiple files drag and drop module in Angular 7, also allows to select multiple files using button given. It gives selected files array as output and you can do whatever you wanted to with them, for example upload to a server.

## Install 

```
npm i angular-file-drag-drop
```

## Usage

- Import AngularFileDragDropModule in your app.module.ts
```
import {AngularFileDragDropModule} from 'angular-file-drag-drop';
```
```
@NgModule({
  imports: [
      ...,
      AngularFileDragDropModule,
      ...
  ]
})
```
**Example-1 ( with default configuration )**
```
<angular-file-drag-drop (select)="onFileSelect($event)"
                        (dropAreaHovering)="onDropAreaHover($event)">
</angular-file-drag-drop>
```
- select event gives the array of selected files. This event occurs on click of Done button.
- dropAreaHovering event gives the boolean, whether the file drop zone is hovered or not.

**Example-2 ( with custom configuration )**

```
<angular-file-drag-drop [maxSize]="2"
                        [maxFiles]="10"
                        [removeButton]="true"
                        [submitBtnText]="'Upload'"
                        [showSupportedFormats]="true"
                        [acceptedFormats]="['.png', '.jpeg', 'gz','.ppk']"
                        (select)="onFileSelect($event)"
                        (dropAreaHovering)="onDropAreaHover($event)">
</angular-file-drag-drop>
```
There are two button Done and Reset:
- Done button fires the select event and gives the selected files array.
- Reset button resets the selected files.

Properties|Description|Deafault Value
---|---|---
maxSize| Maximum size limit for files in MB.|2 MB
maxFile| Maximum number of files allowed to choose.| Null
removeButton| Boolean to show remove file button or not.| true
acceptedFormats| String array of file formats allowed to choose.| []
showSupportedFormats| Boolean to show supported file format or not. | false
submitBtnText| String to show on Done button.| 'Done'

## Coming Soon:
- Directory upload

---
_Source: https://npm.io/package/angular-file-drag-drop · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
