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

Are Regular VACUUM ANALYZE Still Recommended Under 9.1?

Can Feynman Diagrams Be Used To Represent Any Perturbation Theory?