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

490
Views
Cómo ocultar el elemento en angular si una de las dos condiciones es verdadera

Cómo ocultar el elemento en angular si una de las condiciones es verdadera.

Probé con *ngIf="productID == category.Lane || productID == category.Val". no funciona

 <label>ProductID</label> <ng-select appearance="outline" formControlName="productId" [clearable]="false" [searchable]="false" [(ngModel)]="productID" placeholder="Select an option" > <ng-option *ngFor="let product of products | orderBy: 'name'" value="{{ product.id }}">{{ product.name }}</ng-option> </ng-select> <div class="row" *ngIf="productID == category.Lane || productID == category.Val"> <div class="col"> <label>Promotion</label> </div>

over 4 years ago · Santiago Trujillo
2 answers
Answer question

0

Con esta condición:

 *ngIf="productID == category.Lane || productID == category.Val"

Estás diciendo, si la primera o la segunda condición es verdadera, entonces muestra el elemento. Si desea ocultarlo, en ese caso debe usar la condición opuesta:

 *ngIf="!(productID == category.Lane || productID == category.Val)"
over 4 years ago · Santiago Trujillo Report

0

De lo contrario, puede usar el atributo oculto en lugar de usar *ngSi la condición

 <div class="row" [hidden]="productID == category.Lane || productID == category.Val">
over 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!