yodalr yodalr - 1 year ago 70
AngularJS Question

Angular 1: multiple conditions with multiple conditions OR how to exclude conditions if other conditions are true

Right now I have created an extra span to hold one condition.

<div ng-repeat="(key, resultLinks) in resultGroup.resultLinks">
<div ng-if="key < 4 || viewMore" ng-repeat="(subKey, linksWrap) in resultLinks.linksWrap">
<span ng-if="wWidth > 568 || subKey == 0" ng-repeat="links in linksWrap.links">

How would you change it so that all the conditions are in one div. Ie: ng-if="(key < 4 || viewMore) || (wWidth > 568 || subKey == 0)" (something like this, but not quite). Like is it possible to somehow exclude one condition if another is true?

Answer Source

Is this what you're looking for?

(key < 4 || viewMore) && (wWidth > 568 || subKey == 0)
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download