[英]How can i display image in P-fileupload primeng programatically?
[英]how to receive the response of coming from the API specified with the url attribute of p-fileUpload?
我有这个控制:
<p-fileUpload url="http://localhost:8586/upload"
(onUpload)="onUpload($event)"
multiple="multiple">
上传文件后, http://localhost:8586/upload
的 api 返回{key:value}
。 如何访问 api 的此响应?
在 html 所属的同一组件中,编写通过“p-fileupload”组件/库跟踪 output 事件的方法。
示例方法是 -
public onUpload(event): void {
// access key value here. probably event.key
const key = event.key;
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.