Angular 角度图像列表

Angular 角度图像列表,angular,image,ngfor,Angular,Image,Ngfor,我有一个包含src和标题的数组。我需要在数组中循环显示列表中的图像 IMAGES = [ { src: 'https://material.angular.io/assets/img/examples/shiba2.jpg', caption: 'It\'s a thing', }, { src: 'https://picsum.photos/200', caption: 'This is a really long string to see how the text will

我有一个包含src和标题的数组。我需要在数组中循环显示列表中的图像

IMAGES = [
{
  src: 'https://material.angular.io/assets/img/examples/shiba2.jpg',
  caption: 'It\'s a thing',
},
{
  src: 'https://picsum.photos/200',
  caption: 'This is a really long string to see how the text will overflow',
},
{
  src: 'https://picsum.photos/200',
  caption: 'It\'s a thing',
},
{
  src: 'https://picsum.photos/200',
  caption: 'It\'s a thing',
},
{
  src: 'https://picsum.photos/200',
  caption: 'It\'s a thing',
},
{
  src: 'https://picsum.photos/200',
  caption: 'It\'s a thing',
}
];

请检查以下代码,您可以使用div和inside div img标签

<div *ngFor="let image of IMAGES">
    <img [src]="image.src" [attr.alt]="image.caption" [attr.title]="image.caption" width="100" height="100">
</div>

您正在查找
*ngFor
-指令