How does one achieve radio button binding in beta 6?
I found a great plnkr for beta 0 (see http://plnkr.co/edit/aggee6An1iHfwsqGoE3q?p=preview), but when I try to update it to beta 6 it breaks horribly (see http://plnkr.co/edit/voU933?p=preview).
I took a look at the commit that added built-in support for radio options (see https://github.com/angular/angular/commit/e725542), which gives this example
@Component({
template: `
<input type="radio" name="food" [(ngModel)]="foodChicken">
<input type="radio" name="food" [(ngModel)]="foodFish">
`
})
class FoodCmp {
foodChicken = new RadioButtonState(true, "chicken");
foodFish = new RadioButtonState(false, "fish");
}
but my attempts to make that work have so far ended up quite like my failed plnkr.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…