简体   繁体   中英

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?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM