如何以角度显示上传到文件夹的所有图像?

问题描述 投票:0回答:0

我已经使用Node js后端将图像上传到名为uploads的文件夹,该文件夹已成功上传,现在我想在我的前端应用程序中将所有上传的图像显示为图库页面。

我尝试在app.component.ts中引入一个数组,以在每次单击“上传”按钮时推送上载的项目,但是没有用。

public imgarray=[];

  ngOnInit() {

      this.uploader.onAfterAddingFile = (file) => {

      file.withCredentials = false;

      this.imgarray.push('../assets/uploads/'+file);

  };
node.js angular
© www.soinside.com 2019 - 2024. All rights reserved.