我在我的项目中使用crystalui lightbox,并且我已经实现了demo,它工作得很好,但是当我尝试使用dynic data实现它时,它出现了问题,因为文档中显示了lightbox的语法,如下所示
<img src="assets/images/pic1.jpg" [fullImage]="{path: 'assets/images/pic1.jpg'}" > but when i tried to add dynamic data in the loop its not working because of wrong syntex
[fullImage]="{path: 'assets/images/gallery/portrait-2/{{item.image}}'}"请告诉我如何使用我的动态镜像路径{{item.image}},下面是模块站点链接
https://www.npmjs.com/package/@crystalui/angular-lightbox
谢谢
发布于 2020-12-11 22:59:28
你不能像这样使用角度绑定。我将给你一个我的用法的例子。
<img class="img-fluid" id="user-image"
[src]="mediaService.getRenderedImg()"
alt="Sample image"
lightbox
backgroundColor="black"
backgroundOpacity="0.9"
closeButtonText="Close"
[simpleMode]="true"
[fullImage]="{path: mediaService.getRenderedImg()}"
>在您的情况下,您应该将代码更改为:
[fullImage]="{path: 'assets/images/gallery/portrait-2/' + item.image'}"https://stackoverflow.com/questions/64594851
复制相似问题