# angular2-file-drop

> Angular2 component with Drag and Drop support for files

Latest version **0.2.0** (published 2017-02-10) · MIT license · 0 weekly downloads

## Install

```sh
npm install angular2-file-drop
pnpm add angular2-file-drop
yarn add angular2-file-drop
bun add angular2-file-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.2.0 |
| Published | 2017-02-10 |
| First published | 2016-06-06 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 23 |
| Author | Kamil Kisiela |
| Maintainers | kamilkisiela |
| Keywords | angular, angular2, file, drag, drop, upload |

## Links

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

## Dependencies (1)

- [fileapi](https://npm.io/package/fileapi.md) ^2.0.20

## Alternatives

- [unionfs](https://npm.io/package/unionfs.md) — 2.2M weekly downloads
- [path-starts-with](https://npm.io/package/path-starts-with.md) — 35.9K weekly downloads
- [redzip](https://npm.io/package/redzip.md) — 1.2K weekly downloads
- [vscode-anymatch](https://npm.io/package/vscode-anymatch.md) — 848 weekly downloads
- [@ledgerhq/coin-filecoin](https://npm.io/package/@ledgerhq/coin-filecoin.md) — 793 weekly downloads

## Recent versions

- 0.2.0 (latest) — 2017-02-10
- 0.1.0 — 2017-02-07
- 0.0.5 — 2016-10-03
- 0.0.4 — 2016-09-27
- 0.0.3 — 2016-06-07
- 0.0.2 — 2016-06-06
- 0.0.1 — 2016-06-06

## README

# angular2-file-drop

Angular2 component with Drag and Drop support for files

## Install

```bash
npm install angular2-file-drop
```

## Usage

```ts
import { Component, Output } from '@angular/core';
import { FileDropDirective } from 'angular2-file-drop';

@Component({
  selector: 'upload',
  template: `
    <div fileDrop
      [ngClass]="{'file-is-over': fileIsOver}"
      [options]="options"
      (fileOver)="fileOver($event)"
      (onFileDrop)="onFileDrop($event)">
      Drop file here
    </div>
  `,
  directives: [ FileDropDirective ]
})
export class PartiesUpload {
  public fileIsOver: boolean = false;
  @Output() public options = {
    readAs: 'ArrayBuffer'
  };

  private file: File;

  public fileOver(fileIsOver: boolean): void {
    this.fileIsOver = fileIsOver;
  }

  public onFileDrop(file: File): void {
    console.log('Got file!');
  }
}

```

## Options

- **readAs?** : `DataURL`, `ArrayBuffer`, `BinaryString` or `Text`

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