[英]ng-repeat and ng-hide on each
I have the following: 我有以下几点:
<div ng-repeat="(key, value) in group.Subgroups" ng-hide="value.ToBeDeleted" ng-include="'groupTemplate.html'">
How can I make this affect all items in group.Subgroups[]?, and not just the whole div? 如何使它影响group.Subgroups []中的所有项目,而不仅是整个div?
Not tested, but it should be something like this: 未经测试,但应该是这样的:
<div ng-repeat="(key, value) in group.Subgroups">
<div ng-if="!value.ToBeDeleted" ng-include="'groupTemplate.html'">
</div>
</div>
Use ng-if to prevent the template getting rendered into the DOM. 使用ng-if可以防止模板渲染到DOM中。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.