我在html中有两个带有相同选项的选择,如果在任何选择中都选择了一个选项,则我需要隐藏一个选项。如何实现?
我用* ngIf尝试过,但似乎不起作用。
app.component.html
<section>
<form>
<label>Destination 1</label>
<br>
<select (change)="sendData(destination)"
[(ngModel)]="destination.d1"
[ngModelOptions]="{standalone: true}" >
<option *ngFor="let i of sendDestination" value="{{i.name}}">
{{i.name}}
</option>
</select>
<label>Destination 2</label>
<br>
<select (change)="sendData(destination)"
[(ngModel)]="destination.d2"
[ngModelOptions]="{standalone: true}" >
<option *ngFor="let i of sendDestination" value="{{i.name}}">
{{i.name}}
</option>
</select>
</form>
</section>