我想基于我的键值类型为芯片创建边框,我已经为其制作了ng-class =" classEmployeeType($ chip)" ..如果我将它添加到任何固定的dom元素,它工作正常,但在页面加载时创建md-chip。如何在动态创建的dom元素上添加此ng-class。
html
<md-chips ng-model="ctrl.listVal"
md-autocomplete-snap md-transform-chip="$chip" md-require-match="ctrl.autocompleteDemoRequireMatch">
<md-autocomplete>
<md-item-template>
// custom autocomplete functionality
</md-item-template>
</md-autocomplete>
<md-chip-template >
<span>
<strong>@{{$chip.name}}</strong>
</span>
</md-chip-template>
</md-chips>
CSS
.add-key-chips .md-chips .md-chip{
border-radius:2px;
background-color:#fff;
background-color: #fff;
border: 1px solid #027cd8;
cursor: default;
display: block;
height: 20px;
white-space: nowrap;
-webkit-border-radius: 3px;
border-radius: 3px;
line-height:18px;
top:7px;
padding:0 5px;
color: #027cd8;
}