1
需要從數組中動態顯示單選按鈕值,並獲取其值,我需要顯示一個<div>
。請在下面找到如何以角度2動態獲取單選按鈕值?
HTML
<div *ngFor = "let fruit of fruits"
<input type = "radio"/>{{fruit}}>
</div>
component.ts代碼 - >包含以下陣列
fruits : string[] = ["apple", "mango"];
有了這個我收到單選按鈕蘋果和mango.Need來獲取值(分配[(ngModel)],值),並且需要根據單個選擇顯示另一個div。 請指導我在此