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

116
Views
columna de verificación angular en el bucle matCellDef

¿Cómo verificamos una columna en un ng for loop en angular? por ejemplo, no quiero aplicar la lógica a continuación, que es {{element[p.key] != null ? '$': ''}} a la columna 1 o excepto a la columna 1

ingrese la descripción de la imagen aquí

#código HTML

 <table mat-table [dataSource]="bovDemos" class="mat-elevation-z0"> <ng-container *ngFor="let p of marketDemographicsTableLabel; last as l" matColumnDef="{{p.key}}"> <th mat-header-cell *matHeaderCellDef class="fs-12px">{{p.label}}</th> <ng-container > <td mat-cell *matCellDef="let element; index as i" [ngClass]="{'border-none': i === bovDemos.length - 1}" class="fs-12px"> {{element[p.key] != null ? '$' : ''}}{{(element[p.key]) ? (element[p.key] | number): '-'}}</td> </ng-container> </ng-container> <tr mat-header-row *matHeaderRowDef="tableMarketDemographicsHeaders"></tr> <tr mat-row *matRowDef="let row; columns: tableMarketDemographicsHeaders;" class="cursor-default"> </tr> </table>
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Ha establecido "índice como i", por lo que puede usar "i" para detectar el primer td.

 <span *ngIf="i===0"> ..this is first column </span> <span *ngIf="i!==0"> {{element[p.key] != null ? '$' : ''}}{{(element[p.key]) ? (element[p.key] | number): '-'}} </span>
about 4 years ago · Juan Pablo Isaza 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!