如果条件之一为真,如何隐藏角度元素。
我尝试使用 *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)