How to make two questions with ng-if

for example, ng-if = "condition1 condition2" will be correct? Condition 1 may be true and condition 2 false.

The code I'm using is below.

<div flex="40" layout="column" ng-if="expresion1 expresion2" hide-xs>
<div style="background-color:#373f4c; margin:5px;"> 
    <div layout="column" style="background...">
        <md-button .... >
        </md-button>
    </div>
    <ng-include layout="column" src="..."></ng-include>
</div>

+4
source share
1 answer

If you want to display a div when:

one or both variables are true => use OR (cond1 || cond2)

<div flex="40" layout="column" ng-if="expresion1 || expresion2" hide-xs>

both variables must be true => use AND (cond1 && cond2)

<div flex="40" layout="column" ng-if="expresion1 && expresion2" hide-xs>

In your particular case, if I understood correctly, you might have to use the OR operator.

+3
source

All Articles