html - 将类添加到特定的 ng-multiselect-dropdown 项目
问题描述
我正在使用ng-multiselect-dropdown
,我想为列表中的特定项目添加一个类。
HTML
<ng-multiselect-dropdown
[data]="mydata"
[settings]="mysettings"
>
</ng-multiselect-dropdown>
打字稿
有没有办法做这样的事情?
tempList[i] = { ...tempList[i], **cssClass: 'my css code'** };}
getData() {
this.service.getData().subscribe((resp: any) => {
const tempList = resp;
for (let i = 0; i < tempList.length; i++) {
if(mycondition()){
tempList[i] = { ...tempList[i], cssClass: 'my css code' };
}
}
this.mydata = tempList;
}, () => {
});
}
解决方案
推荐阅读
- c# - 无法将自定义组件中的自定义属性保存到 DTSX 文件中
- python - 在 xarray 中打开多个具有相同维度和数据变量的 netcdf 文件
- javascript - 请求返回错误时如何从网站上抓取数据
- google-sheets - 谷歌表multible ImportXMLfails
- html - 如何下载上传到谷歌云存储上的文件而不是查看它?
- javascript - 如何从本地存储中获取存储的对象数组并使用java脚本在浏览器中显示
- firebase - E/MethodChannel#plugins.flutter.io/firebase_database(6299):处理方法调用失败
- java - 掷骰子直到一个值被掷出 1 000 000 次
- laravel - beforeCreate 挂钩中的错误:“TypeError:无法设置属性 $store of #
它只有一个吸气剂 laravel - asp.net-mvc-4 - 如何在 MVC4 中使用 href?我被困在那里