【发布时间】:2020-10-21 06:09:37
【问题描述】:
我有一个包含 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',
}
];
【问题讨论】:
-
您正在寻找
*ngFor-directive