0
我有以下表單。我需要選擇「否」單選按鈕作爲默認值。但是,這似乎並不奏效。當我加載我的頁面時,沒有選擇單選按鈕。什麼會導致檢查不做任何事情?我也用過checked =「checked」,但那也沒用。單選按鈕檢查不工作
<form>
<label class="labelHeader bold">Nausea</label>
<input [(ngModel)]="assessment.nauseous" class="modalCheckbox inline" type="radio" name="nausea" value=true><label>Yes</label>
<input [(ngModel)]="assessment.nauseous" class="modalCheckbox inline" type="radio" name="nausea" value=false checked><label>No</label>
<label class="labelHeader bold">Headache</label>
<input [(ngModel)]="assessment.headache" class="modalCheckbox inline" type="radio" name="headache" value=true><label>Yes</label>
<input [(ngModel)]="assessment.headache" class="modalCheckbox inline" type="radio" name="headache" value=false checked><label>No</label>
</form>
如果您使用的角度,請添加相應的標籤 – j08691