I'm in need of two radio buttons to choose between two options. Here's the code I'm using:
<md-radio-button [value]=true [(ngModel)]="carSelected" name="carOption">Car</md-radio-button>
<md-radio-button [value]=false [(ngModel)]="carSelected" name="busOption">Bus</md-radio-button>
Within my component, I've declared a boolean variable called carSelected
:
public carSelected: boolean = true;
However, the radio buttons aren't updating with the value of carSelected
. Additionally, when a radio button is selected, carSelected
remains unchanged. What could be causing this issue?