Why is this all_font_color not taking effect?
allFontColor in scope is indeed true
大家讲道理2017-05-15 17:01:50
Thank you everyone. I still don’t know how to solve yesterday’s problem. I don’t know why.
Finally I changed the writing method and solved it using class="{{all_font_color_}}"
this method
巴扎黑2017-05-15 17:01:50
You posted the entire code of ng-class. You can’t see it on the right side. I wonder if there is something wrong with your format
PHPz2017-05-15 17:01:50
Determine whether the class exists
Make sure the class style is not overwritten
You can test it in plnkr
phpcn_u15822017-05-15 17:01:50
I feel like you should write like this:
ng-class="{true:'active',false:'inactive'}[tabVal==2]"
The meaning of the above expression is: by judging whether 'tabVal' is equal to 2, To determine the style value of ng-class;
If tabVal==2 is true, then ng-class='active';
where tabVal can be defined in the controller and can be a variable;
active is any class name;