0

I'm trying to write an inline ng-style for multiple conditions in this format;

<div ng-style="thisCondition && {'background-color':'black'},thisCondition2 && {'color':'green'}">

but this code doesn't do anything, please is there any way I can check for multiple conditions in an inline ng-style?

Ike Anya
  • 163
  • 1
  • 7

1 Answers1

0

you should wrap your style in css class and use ng-class :

ng-class="{myClass_1: myVar == true, myClass_2: myVar != true...}"
tmsbrndz
  • 1,297
  • 2
  • 9
  • 23