【发布时间】:2017-03-27 16:37:15
【问题描述】:
在 angular2 中使用 aberezkin/ng2-image-upload
我的模板中有
<image-upload
[max]="1"
[url]="uploadUrl"
[preview]="true"
[buttonCaption]="'Select Images!'"
[dropBoxMessage]="'Drop your images here!'"
(onFileUploadFinish)="imageUploaded($event)"
(onRemove)="imageRemoved($event)"
(isPending)="disableSendButton($event)"
></image-upload>
这是电子商务网站产品捕获/编辑屏幕的较大表单的一部分,包括此图片上传
这对于新产品和新图像来说都很棒,但如果我必须编辑现有产品并因此从服务器获取该产品的数据,包括图像,我如何使用此预填充图像上传图像从而允许用户保留它或删除它/更改它?
还有没有办法过滤允许的文件类型?
【问题讨论】: