I think your example works as expected - even as expected by you ;-) (http://localhost:8080/packages/polymer/src/js/polymer/polymer.js:12)
is only added by the print()
method.
print((e.target as PaperRadioButton).label == 'Male');
prints
false (http://localhost:8080/packages/polymer/src/js/polymer/polymer.js:12)
true (http://localhost:8080/packages/polymer/src/js/polymer/polymer.js:12)
depending on which element you select. Therefore you can just use the label value in your code.
I don't know why print()
adds this though.
In the <app-element>
which I used for this test it adds different text depending on where I print
AppElementConstructor (:1)
attached (:1)
ChangeEventhandler (http://localhost:8080/packages/polymer/src/js/polymer/polymer.js:12)
(I'm already used to (:1)
but the .../polymer.js:12
is new to me. I suppose it is some kind of zone or isolate info.
Info
The selected
attribute of the paper-radio-group
is bound to the name
attribute of the selected paper-radio-button
<paper-radio-group
id="marital-status-group"
selected="{{selectedName}}">
<paper-radio-button name='Married' label='Married'></paper-radio-button><br>
<paper-radio-button name='Divorced' label='Divorced'></paper-radio-button><br>
<paper-radio-button name='Single' label='Single'></paper-radio-button><br>
<paper-radio-button name='Visiting' label='Visiting'></paper-radio-button>
</paper-radio-group>
and in the Dart code of your element
@observable String selectedName;
void selectedNameChanged(old) {
// do something when the another radio button got selected
}