1
UIには2つのラジオボタンが表示され、1つはYESで、1つはNOです。ユーザーがYESラジオをクリックしてからドロップダウンを表示し、テキストボックス、ラジオボタンの切り替え中にドロップダウンとテキストボックスの値をクリアする方法。これは、テキストボックスと前の値を表示するドロップダウンの両方で、switching.pleaseが役に立ちます。角2:ラジオボタンを切り替えるときにドロップダウンとテキストボックスの値をクリアする方法
<div id="radio" class="row">Are you an existing client?</p>
<div class="form-check form-check-inline">
<label class="form-check-label">
<input type="radio" [(ngModel)]="radioValue" value="yes"/>yes
</label>
</div>
<div class="form-check form-check-inline">
<label class="form-check-label">
<input type="radio" [(ngModel)]="radioValue" value="no"/>no
</label>
</div>
</div>
<label *ngIf="radioValue == 'yes'">Select Client</label>
<select #select [(ngModel)]="cuurent" (change)=logDropdown(select.value) class="form-control input-group"
*ngIf="radioValue == 'yes'">
<option *ngFor="let item of list" [value]="item.id">{{item.name}}</option>
</select>
<div class="form-group">
<label *ngIf="radioValue == 'no'">Enter Client</label>
<input type="text" [(ngModel)]="inputsic" class="form-control input-group" *ngIf="radioValue == 'no'" />
</div>
</div>
コードを投稿してください。 –
@gunter zochbauerその異なる質問.iユーザーがredioのボタンを切り替えたときにドロップダウンの以前の値をクリアする必要があります。 –