Skip to content

Commit

Permalink
[FileUpload] transform response url @input
Browse files Browse the repository at this point in the history
  • Loading branch information
greengerong committed Dec 29, 2017
1 parent c46ac71 commit 0b67037
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/app/exports/file-upload/file-upload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,9 @@ export class FileUpload implements AfterViewInit, ControlValueAccessor {

protected onFileUploadSuccess(fileItem, res): Observable<any> {
fileItem.uploadResponse = res;
fileItem.url = this.transformResponseUrl(res);
const responseUrl = this.transformResponseUrl(res) || '';
const url = responseUrl.length ? responseUrl[0] : responseUrl;
fileItem.url = url || fileItem.url;
this.fileUploadSuccess.emit(fileItem);
this.selectFiles = this.selectFiles.filter(item => item !== fileItem);
this.onUploadFileChange([...(this.uploadFiles || []), fileItem]);
Expand Down

0 comments on commit 0b67037

Please sign in to comment.