如何在角度2 * ngFor循环中使用多个PrimeNG Galleria?

时间:2017-10-24 07:00:17

标签: angular primeng

<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'});
}

1 个答案:

答案 0 :(得分:0)

无需列表

  • 。 使用简单的div

    handleHistoryClick(event){
          event.stopPropagation();
          //Some Code To Display Information Using "event"
    }
    

    这应该做的工作