I have >2 group radio button. Every group has >2 radio button. How to get value radio checked.
Asked
Active
Viewed 461 times
1 Answers
0
This is your HTML side:
<div class="form-group">
<label class="radio-inline">
<input
type="radio"
name="options"
id="option1"
[(ngModel)]="dataType" value="100">Radio button 1
</label>
<label class="radio-inline">
<input
type="radio"
name="options"
id="option2"
[(ngModel)]="dataType"
value="99">Radio button 2
</label>
</div>
And this one is your .ts component (.ts) side, just declare is as default value.
public dataType: string = "100"; //Value as default (for selected one)

kboul
- 13,836
- 5
- 42
- 53

rcanpahali
- 2,565
- 2
- 21
- 37
-
And you can use dataType in your class like this >> this.dataType; – rcanpahali Jul 23 '18 at 12:24