尝试将 ng-repeat 从 img 元素移动到父元素 div
Trying to move ng-repeat from img element to parent div
我目前在 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 以便在某些电影的 individual 对象中的元素为真时,我可以向其中添加丝带.这是我正在尝试的:
<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' ?更多类似下面的东西(注意我没有时间测试)
<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>
我目前在 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 以便在某些电影的 individual 对象中的元素为真时,我可以向其中添加丝带.这是我正在尝试的:
<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' ?更多类似下面的东西(注意我没有时间测试)
<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>