“bedingter Inline -Stil Winkel” Code-Antworten

Bedingter Stil Winkel

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

bedingter Inline -Stil Winkel

// ngStyle (conditional Style)
<div *ngFor='let [data] of [dataArray]; let i=index;'>
  <h2 [style.background]="i>1? 'green': 'red'"> {{i}} {{data.title}} </h2>

  </div> 

//if the index of the element is 1 or 0, the background will be red, if it is over 1 the background will be green
Grieving Gharial

Ähnliche Antworten wie “bedingter Inline -Stil Winkel”

Fragen ähnlich wie “bedingter Inline -Stil Winkel”

Durchsuchen Sie beliebte Code-Antworten nach Sprache

Durchsuchen Sie andere Codesprachen