I have a division with a specific class in the CSS named display: none;
. When I click on a button, I switch the class using a toggle class feature called
ng-class="vm.showing ? 'zoomIn' : 'zoomOut'"
. The issue arises when Angular does not populate the ng-repeat element if the style is set to display: none;
.
Edit: My intention is to utilize animate.css, so the code should actually be
ng-class="vm.showing ? 'zoomIn' : 'zoomOut'
Here is the updated code:
<button ng-click="vm.showing = true" type="button">View Panel</button>
<div ng-class="vm.showing ? 'zoomIn' : 'zoomOut'">
<button ng-click="vm.showing = false" type="button">Close Panel</button>
<div ng-repeat="item in vm.items">
...
</div>
</div>
Previous code - no need to consider
<button ng-click="vm.showing = true"type="button">View Panel</button>
<div ng-class="vm.showing ? '' : 'display-none'">
<button ng-click="vm.showing = false" type="button">Close Panel</button>
<div ng-repeat="item in vm.items">
...
</div>
</div>
How can I resolve this issue so that the ng-repeat directive properly populates the repeated element?