小编All*_*n.A的帖子

如果两个条件之一为真,如何隐藏角度元素

如果条件之一为真,如何隐藏角度元素。

我尝试使用 *ngIf="productID ==category.Lane ||productID ==category.Val"。这不起作用。

 <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>
Run Code Online (Sandbox Code Playgroud)

html javascript typescript angular

11
推荐指数
2
解决办法
3万
查看次数

标签 统计

angular ×1

html ×1

javascript ×1

typescript ×1