Angular ngStyle

<div [ngStyle]="{'background-color': (bgColor=='black') ? '#000' : '#fff'}">
Text
</div>

Leave a Reply

Your email address will not be published. Required fields are marked *