Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

237
Views
Color de cambio angular de una celda con condición.

Tengo una tabla y debo cambiar el color de fondo en algunas condiciones:

 <tbody class="custom-cells"> <tr *ngFor="let offer of offers" class="{{offer.step}}" [ngStyle]="{'background-color': offer.status && offer.status=== 'error' ? red : null}"> // I have tried like this but doesn't works <td class="columnStyle">{{offer.date | date:'dd/MM/yyy'}}</td> <td class="columnStyle grid"> {{offer.customer}} </td> <td class="columnStyle"> {{offer.code}} </td> <td class="columnStyle">{{offer.catalog ? offer.catalog : ''}}</td> </td> </tr> </tbody>

el estado de mi oferta puede ser: error, ok, esperando.

¿Cómo puedo cambiar el fondo de la fila con status.offer?

about 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Tienes una variable red indefinida en tu plantilla. Si desea usar el valor CSS "red" , debe usar comillas:

 [ngStyle]="{'background-color': offer.status && offer.status === 'error' ? 'red' : null}"
about 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!