diff --git a/package.json b/package.json index 1131e281..bdec418d 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "ng2-uploader", "description": "Angular2 File Uploader", - "version": "1.0.0", + "version": "1.0.1", "license": "MIT", "main": "ng2-uploader.ts", "author": "Jan Kuri ", @@ -12,7 +12,7 @@ }, "repository": { "type": "git", - "url": "git+https://github.com/jkuri/ng2-uploader.git" + "url": "https://github.com/jkuri/ng2-uploader.git" }, "keywords": [ "ng2", diff --git a/src/directives/ng-file-drop.ts b/src/directives/ng-file-drop.ts index 9413818e..ff48697e 100644 --- a/src/directives/ng-file-drop.ts +++ b/src/directives/ng-file-drop.ts @@ -13,6 +13,7 @@ import {Ng2Uploader} from '../services/ng2-uploader'; }) export class NgFileDropDirective { @Input() options: any; + @Input() events: EventEmitter; @Output() onUpload: EventEmitter = new EventEmitter(); @Output() onPreviewData: EventEmitter = new EventEmitter(); @@ -36,6 +37,12 @@ export class NgFileDropDirective { this.onPreviewData.emit(data); }); + this.events.subscribe((data: string) => { + if (data === 'startUpload') { + this.uploader.uploadFilesInQueue(); + } + }); + this.initEvents(); } diff --git a/src/directives/ng-file-select.ts b/src/directives/ng-file-select.ts index a794070f..f7a67688 100644 --- a/src/directives/ng-file-select.ts +++ b/src/directives/ng-file-select.ts @@ -13,6 +13,7 @@ import { Ng2Uploader } from '../services/ng2-uploader'; }) export class NgFileSelectDirective { @Input() options: any; + @Input() events: EventEmitter; @Output() onUpload: EventEmitter = new EventEmitter(); @Output() onPreviewData: EventEmitter = new EventEmitter(); @@ -35,6 +36,12 @@ export class NgFileSelectDirective { this.uploader._previewEmitter.subscribe((data: any) => { this.onPreviewData.emit(data); }); + + this.events.subscribe((data: string) => { + if (data === 'startUpload') { + this.uploader.uploadFilesInQueue(); + } + }); } filterFilesByExtension(): void {