Search code examples
dartdart-polymer

How to set radio button as checked in dart polymer component


I need to show green radio buttons as checked based on model value. HTML has two input elements of type radio:

<input name="color" type="radio" id="red" value="red"></label>
<input name="color" type="radio" id="green" value="green" checked>

Dart code has a variable colorValue='green'. How can the checked attribute of input element be set based on dart variable? Can this be done in HTML or this must be done in dart code?


Solution

  • <input ... checked?="{{colorValue=='green'}}">