angularjs - ng-class multiple condition in on statement -
i need check if 2 things true decide class. have been trying find solution because believe should pretty common problem. maybe i'm searching wrong things.
i want have 2 conditions in 1 statement, if called?
i've tried similar things this:
ng-class="{'in-behalf-of-background-color' : parameters.username == quote.inbehalfof } ,{'not-in-behalf-of-background-color' : ((parameters.username != quote.inbehalfof) && (quote.inbehalfof != 'null'))}"
as can see want check parameters.username != quote.inbehalfof , if quote.inbehalfof != null in same condition. possible?
try code;
you want multiple condition define 1 object , define conditions key value pair {key1:value1, key2: value2}
ng-class="{'in-behalf-of-background-color' : parameters.username == quote.inbehalfof, 'not-in-behalf-of-background-color' : ((parameters.username != quote.inbehalfof) && (quote.inbehalfof)) }"
Comments
Post a Comment