From d5bb4abfbf26014438684917e16f3d7c3c8b6475 Mon Sep 17 00:00:00 2001 From: parag-patwardhan Date: Sat, 17 Dec 2016 00:00:33 +0530 Subject: [PATCH] Moved get after set to fix issue when initializing in Angular2 (#154) --- src/directives/ng-file-drop.ts | 8 ++++---- src/directives/ng-file-select.ts | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/directives/ng-file-drop.ts b/src/directives/ng-file-drop.ts index 625f9250..47c3e702 100644 --- a/src/directives/ng-file-drop.ts +++ b/src/directives/ng-file-drop.ts @@ -22,16 +22,16 @@ export class NgFileDropDirective { _options:any; - get options(): any { - return this._options; - } - @Input('options') set options(value: any) { this._options = value; this.uploader.setOptions(this.options); } + get options(): any { + return this._options; + } + files: any[] = []; uploader: Ng2Uploader; diff --git a/src/directives/ng-file-select.ts b/src/directives/ng-file-select.ts index 03b9928a..b1170d1d 100644 --- a/src/directives/ng-file-select.ts +++ b/src/directives/ng-file-select.ts @@ -21,16 +21,16 @@ export class NgFileSelectDirective { _options: any; - get options(): any { - return this._options; - } - @Input('options') set options(value: any) { this._options = value; this.uploader.setOptions(this.options); } + get options(): any { + return this._options; + } + files: any[] = []; uploader: Ng2Uploader;