Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

danbachar-angular2-image-upload

danbachar35MIT3.0.0TypeScript support: included

An angular component that uploads images using native browser upload or drag-n-drop.

image, upload, angular, ng, image, preview, file, upload, drag, drop, drag&drop

readme

Image Upload Module

Build Status

This angular library provides a light-weight component that handles file-drop, image previewing and image uploading.

Demo & Readme

Install

npm install angular2-image-upload --save

Usage

In your app.module.ts import it using @NgModule decorator.

import { ImageUploadModule } from "angular2-image-upload";

@NgModule({
    imports: [
        ...,
        ImageUploadModule.forRoot(),
        ...
    ]
})

Now you have image-upload declaration and you can use it in your html code.

<image-upload></image-upload>

You can use bindings to configure this element for your needs.

See the demo for more detailed instructions.

changelog

Change Log

All notable changes to this project will be documented in this file. See standard-version for commit guidelines.

1.0.0-rc.0 (2017-09-28)

Bug Fixes

  • css: prefix all classes to prevent external style cascading (#114) (277bcf7)
  • dependencies: add http module to imports (24ee042), closes #80
  • input: fixed extensions not working when not specified (#83) (204ab16), closes #82
  • output: emit onRemove when all files are cleared (#85) (f4b4c05), closes #84

Chores

  • api: made api conform to angular conventions (#87) (29d288e)

Features

  • input: added the ability to pass a beforeUpload function that can modify each file/url or abort entirely (#101) (9a883b8), closes #59
  • input: allow clear button text to be customised (#100) (df66c86), closes #97
  • allow custom form data (098febd)
  • allow custom styling - fixes #93 (#116) (a1aa8f4)
  • retrieve files on open (#130) (45e4472)

BREAKING CHANGES

  • api: headers now accepts a map instead of an array.

Typescript signature: [name: string]: any;

  • api: onFileUploadFinish renamed to uploadFinished
  • api: onRemove renamed to removed
  • api: isPending renamed to uploadStateChanged

0.6.5 (2017-07-01)

Bug Fixes

  • dependencies: add http module to imports (24ee042), closes #80
  • input: fixed extensions not working when not specified (#83) (204ab16), closes #82
  • output: emit onRemove when all files are cleared (#85) (f4b4c05), closes #84