I am having an issue with a radio button where I need to display a value when it is clicked. For example, when the "weekly" option is selected, I want it to display "Weekly" in the "Selection" element. I have tried to implement this but it is not working as expected. Can someone guide me on what changes I need to make to achieve this?
Here is my code:
HTML
<form [formGroup]="form" (ngSubmit)="submit()">
<label *ngFor="let order of orders">
<input formControlName="orders" type="radio" name="orders" [value]="order.id" />
{{order.name}}
</label>
<br>
<label *ngFor="let radiobutton of options">
<input type="radio" class="justify-right" formControlName="options" name="options" [value]="radiobutton.id">{{radiobutton.name}}
</label>
<p>Selection: {{options.name}}</p>
<button>submit</button>
</form>
And here is my component code:
TS
// Component logic goes here
For reference, please visit here.
Any help or guidance would be greatly appreciated.
Thank you!