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

Chemistry - Bond Angles In NH3 And NCl3

Are Regular VACUUM ANALYZE Still Recommended Under 9.1?

Change The Font Size Of Visual Studio Solution Explorer