Reputation: 55
columnClass: string[] = ['name', 'email', 'phn', 'city', 'state', '', 'w-40'];
<td *ngFor="let col of columnClass" class="pr-20 {{col}}">
string[]
is in one component.ts and html
is in another component.html
Upvotes: 0
Views: 100
Reputation: 422
You need to bind to the class to use variables inside of it.
<td *ngFor="let col of columnClass" class="pr-20" [class]="col">
Upvotes: 1