Socket
Socket
Sign inDemoInstall

angular2-file-drop

Package Overview
Dependencies
1
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    angular2-file-drop

Angular2 component with Drag and Drop support for files


Version published
Weekly downloads
37
decreased by-63.73%
Maintainers
1
Install size
576 kB
Created
Weekly downloads
 

Readme

Source

angular2-file-drop

Angular2 component with Drag and Drop support for files

Install

npm install angular2-file-drop

Usage

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

Keywords

FAQs

Last updated on 10 Feb 2017

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc