input[type=radio]
page
Cross bind a value to a radio input.
Binding to radios
To bind to a radio input, if you have a set of boolean values you can bind to the input's checked property as you do with input[type=checkbox].
<input type="radio" {($checked)}="one" /> One
<input type="radio" {($checked)}="two" /> Two
var template = stache.from("demo");
var map = new DefineMap({
one: true,
two: false
});
document.body.appendChild(template(map));
Binding to a selected value
More often than binding to boolean values of each radio's checked value, you will want to know what the value is of the radio group. Since each radio has it's own value, the radio's selected value is the value of the radio item that is selected.
Using the converter equal you can bind a value within your scope to the radio group's selected value: