<li *ngFor="let image of images">
<img src="assets/images/{{image.href}}" />
</li>
这是我的代码,内部的每个 li循环从数据库获取多个图片,
如何在 li循环中使用 PrimeNG Galleria 。?
默认 PrimeNG Galleria HTML代码
<p-galleria [images]="images" panelWidth="500" panelHeight="313"></p-galleria>
默认的 PrimeNG Galleria Component.ts代码为
images: any[];
ngOnInit() {
this.images = [];
this.images.push({source:'assets/img/gal1.jpg', alt:'Description 1', title:'Title 1'});
this.images.push({source:'assets/img/gal2.jpg', alt:'Description 2', title:'Title 2'});
this.images.push({source:'assets/img/gal3.jpg', alt:'Description 3', title:'Title 3'});
this.images.push({source:'assets/img/gal4.jpg', alt:'Description 4', title:'Title 4'});
}
答案 0 :(得分:0)
无需列表
handleHistoryClick(event){
event.stopPropagation();
//Some Code To Display Information Using "event"
}
这应该做的工作