如何使用ng-select将角度检查作为Angular 4中所选字段的背景图像

时间:2018-04-05 05:52:18

标签: angular sass font-awesome

我有一个ng-select字段,我想在下拉列表中为所选字段设置复选标记,所以我想使用fontawesome check,但我没有得到如何设置,可以任何人帮助我

HTML:

 <ng-select class="box"  placeholder="{{selected}}" [options]="company" [(ngModel)]="selected"></ng-select>




SCss:
.box {
    select-dropdown .selected {
    color: #82ffe4 !important;
    background-color: #4389a9 !important;
    font-size: 14px;
    font-family: MontserratRegular;
 }
}

TS:

this.company = [
    { label:"Wiredelta",value: "Wiredelta" },
    { label:"Timer", value: "Timer" },
    { label:"Artifu", value: "Artifu" },
    { label:"BoatButler", value: "BoatButler" },
  ];
    this.selected="Wiredelta";

1 个答案:

答案 0 :(得分:0)

通过像这样给出scss来解决这个问题

select-dropdown .selected:after {
    font-family: FontAwesome;
    content: "\f00c";
    float: right;
    margin-right: -6px;
  }