我在项目中使用angular2-multiselect。 我使用设置属性来应用文本,类(CSS)之类的属性。 在这里,我需要将默认文本“选择旅行者”的颜色更改为灰色,但是我使用的CSS类仅应用于多选下拉列表框中的项目。
angular2-multiselect: .html
<angular2-multiselect formControlName="arrayTravellerIds" [data]="itemList" [(ngModel)]="selectedItems"
[settings]="settings" (onSelect)="onItemSelect($event)" (onDeSelect)="OnItemDeSelect($event)"
(onSelectAll)="onSelectAll($event)" (onDeSelectAll)="onDeSelectAll($event)">
<c-badge>
<ng-template let-item="item">
<label style="margin: 0px;">{{item.itemName}} - {{item.strEmail}} - {{item.mobileNumber}}</label>
</ng-template>
</c-badge>
<c-item>
<ng-template let-item="item">
<label style="min-width: 220px;">{{item.itemName}}</label>
<label style="min-width: 220px;">{{item.strEmail}}</label>
<label>{{item.mobileNumber}}</label>
</ng-template>
</c-item>
</angular2-multiselect>
angular2-multiselect:.ts
this.settings = {
text: "Select Travellers",
selectAllText: 'Select All',
unSelectAllText: 'UnSelect All',
enableSearchFilter: true,
classes: "myclass custom-class",
showCheckbox: true,
badgeShowLimit: 5
};