bergben / ng2-file-input

Angular 2 component that implements a drag and drop or select file selection, including preview.
MIT License
25 stars 11 forks source link

[show-previews] value is not editable. #3

Closed cronosxfiles closed 7 years ago

cronosxfiles commented 7 years ago

I've tried to hide the selected file previews since I'm only interested in directly showing the compressed image result. However, the previews are always visible. I think the issue lies in the code for file ng2-file-input.component.ts, line 52:

this.showPreviews = this.showPreviews || this.defaultOptions.showPreviews;

Since this is an OR comparison, if the default option is true, then no matter which is the input's value for [show-previews], the expression will always result true.

So far I've managed to hide it by overriding its CSS class:

.ng2-file-input-files   {
  display: none;
}
bergben commented 7 years ago

Hey @cronosxfiles ! Thanks for reporting this issue! I have just published version 0.1.13 which fixes this problem :)