我在向表中插入数据时遇到问题。这是我的代码示例:
protected paginateCompliances(data: ICompliance[], headers: HttpHeaders) {
this.links = this.parseLinks.parse(headers.get('link'));
const rows: ICompliance[] = [];
for (let b = 0; b < this.manualDatas.length; b++) {
const comp = new Compliance();
comp.type = this.manualDatas[b];
for (let i = 0; i < data.length; i++) {
const compliance = data[i];
if (comp.type === compliance.type) {
rows.push(data[i]);
console.log('New data added');
} else {
rows.push(comp);
}
}
}
this.compliances = rows;
this.isLoading = false;
}
我真正想要的是,当数据为空时,它应该为空样式,看起来像灰色行。但是,当有数据时,它会显示数据。有什么建议吗?