我构建了Btn风格,所以我只想将其定制为新样式,如
<style>
.btn.activeother {
color: #fff;
background-color:Red;
}
</style>想要像这样使用它
<div class="btn-group col-md-10 segmented-label" >
<label ng-repeat="list in inputarray" name="{{assessmenttype}}"
ng-model="$parent.selecteditem" ng-class="{'btn activeother':selecteditem==list.score && selecteditem!= normalscore }" btn-radio="{{list.score}}">{{list.name}}</label>
</div>在这里,我将normalscore作为2传递,我有3个项目,每个项目包含列表得分为1,2,3,列表名称为a,b,c
因此,我希望使用ng类设置服装css类.btn.activeother,这样如果选择项目得分与正常相同,我希望应用.btn.activeother,而不是默认的btn活动。
所以,请帮助我解决这个问题,目前我的ng班没有处理这个问题,请告诉我什么是正确的?
发布于 2015-07-22 06:38:52
定义了类.btn和.activeother类的条件检查
<div class="btn-group col-md-10 segmented-label" >
<label ng-repeat="list in inputarray" name="{{assessmenttype}}"
ng-model="$parent.selecteditem" class="btn" ng-class="{'activeother':selecteditem ==list.score && selecteditem != normalscore }" btn-radio="{{list.score}}">{{list.name}}</label>
</div>https://stackoverflow.com/questions/31555274
复制相似问题