Issue
I am using the below code. I am using Angular 12.
<div class="container">
<div class="row">
<div [class.col-sm-4]="true"> </div>
</div>
</div>
When I see the UI, I am not getting col-Sm-4 class attribute there for div. what can be the reason for it ? and how to overcome from it. ?
Solution
You can use ngClass for this. For example:
[ngClass]="yourConditionHere == true? 'col-sm-4': '' "
Answered By - Haris Iqbal
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.