gpt4 book ai didi

javascript - 尝试将 ng-repeat 从 img 元素移动到父 div

转载 作者:行者123 更新时间:2023-12-03 06:47:10 26 4
gpt4 key购买 nike

我目前在 img 元素上有一个 ng-repeat,看起来像这样:

<div class="mainContent" Overflow:scroll style="">
<img class="imgClass" ng-src="{{movie.imgPath}}" ng-click="openInfo(movie)" data-ng-repeat="movie in filteredResults = (moviesArray | orderBy : 'title' | filter:{a bunch of filters}"/>
</div>

我正在尝试将 ng-repeat 移动到父 div 中,以便在某些电影的单个对象中的元素为 true 时,我可以向其中添加功能区。这是我正在尝试的:

<div class="mainContent" Overflow:scroll style="" data-ng-repeat="movie in filteredResults = (moviesArray | orderBy : 'title' | filter:{a bunch of filters}">
<img class="imgClass" ng-src="{{movie.imgPath}}"/>
</div>

当我这样做时,什么也没有出现。知道发生了什么吗?

提前致谢!

最佳答案

通常,您只需将图像标签包装在 div 中并将 ng-repeat 移动到那里,而不是移动到父“mainClass”,该父“mainClass”似乎是容器节点,并且可能具有冲突的样式等?更多类似下面的内容(注意我还没有时间测试)

<div class="mainContent" Overflow:scroll style="">
<div ng-src="{{movie.imgPath}}" ng-click="openInfo(movie)" data-ng-repeat="movie in filteredResults = (moviesArray | orderBy : 'title' | filter:{a bunch of filters}">
<img class="imgClass">
</div>
</div>

关于javascript - 尝试将 ng-repeat 从 img 元素移动到父 div,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37684156/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com