我没有看到任何表明为什么这不起作用。Angular Doc说“如果表达式计算为字符串,则该字符串应该是一个或多个以空格分隔的类名。” 我在这段代码中做错了什么?
不起作用:
<div ng-class="myClass">
Using ng-class (with no quotes so maybe it doesn't evaluate to a String).
</div>
不起作用:
<div ng-class="'myClass'">
Using ng-class (with quotes around the class name so it is (?) evaluated to a String).
</div>
作品:
<div class="myClass">
Using regular class, no ng-class.
</div>