Hello I have angular reactive forms my code looks like this:
this.rForm = fb.group({
'membership' : '',
'pointed' : '',
});
so I'm getting values after submit form
this.selectedMembership = this.rForm.get('membership').value;
this.pointed = this.rForm.get('pointed').value;
html code lools like this:
<div class="membership">
<div *ngFor="let m of membership | async" class="membershipBtnGroup " data-toggle="buttons">
<input type="radio" formControlName="membership" value="{{ m.level }}" id="{{ m.title }}" class="input-hidden" />
<label for="{{ m.title }}">
<img src="{{ m.imageUrl }}">
<br><br>
<input type="text" pattern="[0-9]*" formControlName="pointed" value="{{ m.points }}" class="form-control pointed">
</label>
</div>
</div>
so on click to image, it is selecting radio input and getting value of m.level. I have small css code when it clicks to image another text input "pointed" is showing width default m.points value, but if I change this text input to other value it is saving this value but if I not touched and not changed it is not saving default value
<input type="text" pattern="[0-9]*" formControlName="pointed" value="{{ m.points }}" class="form-control pointed">
so when I click image
<img src="{{ m.imageUrl }}">
it is showing radio and text inputs, radio data is saving correctly but text input data (width default value, if I not touched) not saving.
I want to get default value if I not touched and not changed input, but if I will change input it must save new value.