columnClass:string[]=['name','email','phn','city','state','','w-40'];
<td *ngFor="let col of columnClass" class="pr-20 {{col}}">
string[]
在一个组件.ts中,html
在另一个组件.html中
您需要绑定到类才能使用其中的变量。
<td *ngFor="let col of columnClass" class="pr-20" [class]="col">