Angular 10 Ngstyle Conditional Example


Example 1: conditional style angular

<div [ngStyle]="{'color':employee.country === 'India' ? 'orange' : 'red' }"></<div>

Example 2: ngstyle conditional

<div [ngClass]="{'class1': true, 'class2': false}"></div> <!--passed as an object-->

Comments

Popular posts from this blog

Converting A String To Int In Groovy

"Cannot Create Cache Directory /home//.composer/cache/repo/https---packagist.org/, Or Directory Is Not Writable. Proceeding Without Cache"

Android How Can I Convert A String To A Editable