angular2-image-upload
Advanced tools
Comparing version 0.6.4 to 0.6.5
{ | ||
"name": "angular2-image-upload", | ||
"version": "0.6.4", | ||
"version": "0.6.5", | ||
"description": "An angular component that uploads images using native browser upload or drag-n-drop.", | ||
@@ -8,3 +8,5 @@ "main": "index.js", | ||
"build": "rm -rf lib codegen .tmp && gulp build && ngc -p src/tsconfig.json", | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
"test": "echo \"Error: no test specified\" && exit 1", | ||
"release": "standard-version", | ||
"publish": "git push --follow-tags origin master && npm publish" | ||
}, | ||
@@ -51,4 +53,5 @@ "repository": { | ||
"rxjs": "^5.0.0-rc.2", | ||
"standard-version": "^4.2.0", | ||
"typescript": "2.1.5" | ||
} | ||
} |
# Image Upload Module | ||
[![Build Status](https://travis-ci.org/aberezkin/ng2-image-upload.svg?branch=master)](https://travis-ci.org/aberezkin/ng2-image-upload) | ||
@@ -3,0 +4,0 @@ This angular 2 library provides a light-weight component that handles file-drop, image previewing and image uploading. |
@@ -1,10 +0,13 @@ | ||
import {NgModule, ModuleWithProviders} from "@angular/core"; | ||
import {ImageUploadComponent} from "./image-upload/image-upload.component"; | ||
import {FileDropDirective} from "./file-drop.directive"; | ||
import {CommonModule} from "@angular/common"; | ||
import {ImageService} from "./image.service"; | ||
import { CommonModule } from '@angular/common'; | ||
import { ModuleWithProviders, NgModule } from '@angular/core'; | ||
import { HttpModule } from '@angular/http'; | ||
import { FileDropDirective } from './file-drop.directive'; | ||
import { ImageUploadComponent } from './image-upload/image-upload.component'; | ||
import { ImageService } from './image.service'; | ||
@NgModule({ | ||
imports: [ CommonModule ], | ||
imports: [ | ||
CommonModule, | ||
HttpModule | ||
], | ||
declarations: [ | ||
@@ -11,0 +14,0 @@ ImageUploadComponent, |
@@ -45,3 +45,3 @@ import { Component, ElementRef, EventEmitter, Input, OnInit, Output, ViewChild } from '@angular/core'; | ||
@Input('extensions') | ||
supportedExtensions: string[] = ['image/*']; | ||
supportedExtensions: string[]; | ||
@@ -59,5 +59,4 @@ private pendingFilesCounter: number = 0; | ||
} | ||
if (this.supportedExtensions) { | ||
this.supportedExtensions = this.supportedExtensions.map((ext) => 'image/' + ext); | ||
} | ||
this.supportedExtensions = this.supportedExtensions ? this.supportedExtensions.map((ext) => 'image/' + ext) : ['image/*']; | ||
} | ||
@@ -88,2 +87,4 @@ | ||
deleteAll() { | ||
this.files.forEach(f => this.onRemove.emit(f)); | ||
this.files = []; | ||
@@ -90,0 +91,0 @@ this.fileCounter = 0; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
74147
28
782
91
0
12
683