我有一个嵌套的ng-repeat
。我想通过动态选项来排列内部列表的顺序。
即sort_option
值来自动态获取的 $scope
变量。这将使所有内部 ul
列表按排序顺序排列,但我只想对循环内的一个列表进行排序。
<ul>
<li ng-repeat='itemsli in mylists.lists'>
<ul>
<li ng-repeat="item in list | orderBy: sort_option | filter: {due_date_time : current_date_time}">
{{item.name}}
</li>
</ul>
</li>
</ul>
最佳答案
像这样更改行,在过滤器末尾添加 : true
<li ng-repeat="item in list | orderBy: sort_option | filter: {due_date_time : current_date_time}: true ">
关于javascript - Angular js ng-repeat 和过滤器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40716083/