Skip to content

Commit

Permalink
feat(file): remove files variable since it was deprecated in a prev…
Browse files Browse the repository at this point in the history
… release (#1028)
  • Loading branch information
emoralesb05 authored Dec 13, 2017
1 parent 7a30cb5 commit cff2b7a
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ <h3 class="mat-title">Multiple selection/drop for only .sql files and custom col
<td-file-upload #fileMultipleUpload (select)="selectMultipleEvent($event)" (upload)="uploadMultipleEvent($event)" (cancel)="cancelMultipleEvent()"
accept=".sql" defaultColor="accent" activeColor="warn" cancelColor="primary" multiple [disabled]="disabled">
<mat-icon>file_upload</mat-icon>
<span>{{ fileMultipleUpload.files?.name || fileMultipleUpload.files?.length }} <span *ngIf="fileMultipleUpload.files?.length">files selected</span></span>
<span>{{ fileMultipleUpload.value?.name || fileMultipleUpload.value?.length }} <span *ngIf="fileMultipleUpload.value?.length">files selected</span></span>
<ng-template td-file-input-label>
<mat-icon>attach_file</mat-icon>
<span>
Expand All @@ -115,7 +115,7 @@ <h3 class="mat-title">Multiple selection/drop for only .sql files and custom col
accept=".sql" defaultColor="accent" activeColor="warn" cancelColor="primary" multiple [disabled]="disabled">
<mat-icon>file_upload</mat-icon>
<span>
{ { fileMultipleUpload.files?.name || fileMultipleUpload.files?.length } } <span *ngIf="fileMultipleUpload.files?.length">files selected</span>
{ { fileMultipleUpload.value?.name || fileMultipleUpload.value?.length } } <span *ngIf="fileMultipleUpload.value?.length">files selected</span>
</span>
<ng-template td-file-input-label>
<mat-icon>attach_file</mat-icon>
Expand Down
2 changes: 1 addition & 1 deletion src/platform/core/file/file-upload/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Example for usage:
```html
<td-file-upload #fileUpload [(ngModel)]="files" defaultColor="accent" activeColor="warn" cancelColor="primary" (select)="selectEvent($event)"
(upload)="uploadEvent($event)" (cancel)="cancelEvent()" accept=".ext,.anotherExt" [disabled]="disabled" multiple>
<mat-icon>file_upload</mat-icon><span>{{ fileUpload.files?.name }}</span>
<mat-icon>file_upload</mat-icon><span>{{ files?.name }}</span>
<ng-template td-file-input-label>
<mat-icon>attach_file</mat-icon>
<span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ describe('Component: FileUpload', () => {
fixture.whenStable().then(() => {
expect(fixture.debugElement.query(By.css('td-file-input'))).toBeTruthy();
expect(fixture.debugElement.query(By.css('.td-file-upload'))).toBeFalsy();
expect(fixture.debugElement.query(By.directive(TdFileUploadComponent)).componentInstance.files)
expect(fixture.debugElement.query(By.directive(TdFileUploadComponent)).componentInstance.value)
.toBeUndefined();
});
});
Expand Down Expand Up @@ -81,7 +81,7 @@ describe('Component: FileUpload', () => {
fixture.whenStable().then(() => {
expect(fixture.debugElement.query(By.css('td-file-input'))).toBeTruthy();
expect(fixture.debugElement.query(By.css('.td-file-upload'))).toBeFalsy();
expect(fixture.debugElement.query(By.directive(TdFileUploadComponent)).componentInstance.files).toBeUndefined();
expect(fixture.debugElement.query(By.directive(TdFileUploadComponent)).componentInstance.value).toBeUndefined();
});
});
});
Expand Down Expand Up @@ -196,7 +196,7 @@ describe('Component: FileUpload', () => {
template: `
<td-file-upload #fileUpload [multiple]="multiple" [disabled]="disabled" (select)="selectEvent($event)"
(upload)="uploadEvent($event)" (cancel)="cancelEvent()">
<span>{{ fileUpload.files?.name }}</span>
<span>{{ fileUpload.value?.name }}</span>
<ng-template td-file-input-label>
<span>Choose a file...</span>
</ng-template>
Expand Down
7 changes: 0 additions & 7 deletions src/platform/core/file/file-upload/file-upload.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,6 @@ export class TdFileUploadComponent extends _TdFileUploadMixinBase implements ICo
private _multiple: boolean = false;
private _required: boolean = false;

/**
* @deprecated use value property instead
*/
get files(): FileList | File {
return this.value;
}

@ViewChild(TdFileInputComponent) fileInput: TdFileInputComponent;

@ContentChild(TdFileInputLabelDirective) inputLabel: TdFileInputLabelDirective;
Expand Down

0 comments on commit cff2b7a

Please sign in to comment.