【问题标题】:aberezkin/ng2-image-upload how can I prepopulate the imageaberezkin/ng2-image-upload 如何预填充图像
【发布时间】: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>

这是电子商务网站产品捕获/编辑屏幕的较大表单的一部分,包括此图片上传

这对于新产品和新图像来说都很棒,但如果我必须编辑现有产品并因此从服务器获取该产品的数据,包括图像,我如何使用此预填充图像上传图像从而允许用户保留它或删除它/更改它?

还有没有办法过滤允许的文件类型?

【问题讨论】:

    标签: image angular upload


    【解决方案1】:

    所以你想让用户选择图像并能够在上传之前更改它

    我做了一个简单的预览和上传图片的例子,我想对你有帮助

    Preview and uploade image angular2

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-01-08
      • 2017-10-08
      • 2021-11-08
      • 2018-04-25
      • 2017-08-02
      • 2013-07-27
      相关资源
      最近更新 更多