javascript - AngularJs ng-show for when an item in a list is true in one line -
i have status want if there bool set true want toggle. bool attached items in list. take look:
<div ng-repeat="step in progress.steps"> <div ng-if="step.criticalerror"> </div> </div>
simple enough.
now problem!
take step backward containing divs. want handle scenario this..have 3 divs. 2 show @ time. factor determines criticalerror. or nothing, if 1 trips critical error steps show on top; otherwise show below if there no critical. this.
<div ng-show="containscriticalerror"></div> <div>always shows.</div> <div ng-show="!containscriticalerror"></div>
or have iterate through list, possible stop ng-repeat 1 time status met?
what this?
<div ng-show="!containscriticalerror">always shows.</div> <div> <div ng-repeat="step in progress.steps"> <div ng-if="step.criticalerror"> </div> </div> </div> <div ng-show="containscriticalerror">always shows.</div>
or move div css?
javascript angularjs
No comments:
Post a Comment