Akhil
Akhil

Reputation: 443

when apply class binding to mat-card, mat-card class is not binding

when apply single class binding to mat-card, mat-card class is not binding.

<mat-card cdkDropList [className]="getClassName(item)"><!-- some content--></mat-card>

In this case we wont be able to see class name as mat-card and no style been applied from material.

enter image description here

Upvotes: 0

Views: 446

Answers (1)

TotallyNewb
TotallyNewb

Reputation: 4820

Just use the standard [class] binding, e.g.

<mat-card cdkDropList [class]="getClassName(item)">
  <!-- some content-->
</mat-card>

Example based on forked example from docs here.

Upvotes: 1

Related Questions