javascript - Angular ngClass multiple ternary operator conditions -


what best way put more 1 ternary conditional class in angular's ngclass directive, values class-names?

i've tried few variations on this, compiling error:

ng-class="$index > 2 ? 'l3 m4 s12 medium' : 'l4 m6 s12 medium', true ? 'red':'blue'

ng-class="{$index > 2 ? 'l3 m4 s12 medium' : 'l4 m6 s12 medium', true ? 'red':'blue'}

my preferred syntax ng-class following, since explicit classes adding.

ng-class={ 'classname' : yourconditionhere, 'class2' : anotherconditionhere } 

give try.


Comments

Popular posts from this blog

javascript - Google App Script ContentService downloadAsFile not working -

javascript - Function overwritting -

c# - Exception when attempting to modify Dictionary -