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?

Upvotes: 0

Views: 61

Answers (1)

Eigi
Eigi

Reputation: 716

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.

Upvotes: 1

Related Questions