复杂的角度JS纳克级
我有分量和有问题的CSS类设置它。
我想它总有一类盒子,再到具有由指令类的说法,一个有条件的类迷你。
I have the component and have a problem setting the css class to it. I want it to always have a class of "box", then to have additional classes specified by the directive "class" argument and one conditional class "mini".
我概念想达到的目标是这样的:
Conceptually what I want to achieve is something like this:
<div class="box {{class}}" data-ng-class="{mini: !isMaximized}">
...
</div>
问题是,当我设置类HTML属性,省略了NG-class属性。
如何使不改变控制我的示例工作?它甚至有可能,还是应该设置类控制器,而不是(我想避免)?
The problem is that when I set the class html attribute, the ng-class attribute is omitted. How to make my example work without changing the controller? Is it even possible, or should I set the class in the controller instead (which I wish to avoid)?
我需要的地方一人$范围派生和其他人的文字类的多个类。感谢来自安德烈提示,以下为我工作。
I needed multiple classes where one was $scope derived and others were literal classes. Thanks to the hint from Andre, below worked for me.
<h2 class="{{workStream.LatestBuildStatus}}"
ng-class="{'expandedIcon':workStream.isVisible, 'collapsedIcon':!workstream.isvisible}">{{workStream.Name}}</h2>