<input #fileUpload [hidden]="true" type="file" ng2FileSelect [uploader]="uploader" [multiple]="multiple" />
<ng-container *ngIf="!multiple; else fileMultiple;">
	<div class="app-file-upload">
		<div class="app-file-upload-content">
			<ion-chip *ngFor="let item of files; let i = index;">
				<ion-label (tap)="downloadFile(item)">{{ item.name | slice:0:9 }} {{ item.name.length > 10 ? '...' : '' }}</ion-label>
				<ion-icon [hidden]="disabled" name="close-circle" (click)="deleteFile(item.id, i)"></ion-icon>
			</ion-chip>
		</div>
		<div class="app-file-upload-button">
			<ion-icon class='add-icon' [hidden]="disabled || (files.length >= fileCount)" name="add" (click)="fileSelect()"
			 color="primary"></ion-icon>
		</div>
	</div>
</ng-container>
<ng-template #fileMultiple>
	<div class="app-file-upload-multiple">
		<ion-item *ngIf="labelText" class="app-file-upload-title" lines="none">
			<ion-label slot="start">
				{{ labelText }}<span class="stars" *ngIf="allowEmpty">*</span>
			</ion-label>
			<span slot="end">
				<ion-icon class='add-icon' class="app-file-upload-button" [hidden]="disabled || (files.length >= fileCount)" name="add"
				 (click)="fileSelect()" color="primary"></ion-icon>
			</span>
		</ion-item>
		<div class="app-file-upload-content">
			<ion-item class="app-file-upload-list-item" *ngFor="let item of files; let i = index;" lines="full">
				<label (tap)="downloadFile(item)">
					{{ item.name }}
				</label>
				<ion-icon slot="end" [hidden]="disabled" name="close" (click)="deleteFile(item.id, i)" color="primary"></ion-icon>
			</ion-item>
		</div>
	</div>
</ng-template>