angularjs - How do you change all ng-show dependent variables in an ng-repeat? -
i have ng-repeat has ng-if attached it, child element changing ng-click. code looks following:
<div ng-repeat="object in objects" ng-if="show"> <div ng-click="show = !show">show</div> </div>
lets had 2 objects
, load 2 repeated divs, , there 2 'show' elements. when click show, remove 1 of repeated elements page. need remove both. thoughts?
if want hide wrap of in outer div , place "ng-if" there.
<div ng-if="show"> <div ng-repeat="object in object"> <div ng-click="show = !show">show</div> </div> </div>
i advise place logic modifies data in ts file instead of in html view.
wiki
Comments
Post a Comment