mirror of
https://github.com/donl/meteor-ionic.git
synced 2026-05-26 22:06:41 -06:00
29 lines
450 B
JavaScript
29 lines
450 B
JavaScript
Template.ionRadio.helpers({
|
|
inputAttrs: function () {
|
|
var attrs = {
|
|
type: 'radio'
|
|
};
|
|
|
|
if (this.name) {
|
|
attrs.name = this.name;
|
|
} else {
|
|
attrs.name = 'radio-group';
|
|
}
|
|
|
|
if (this.value) {
|
|
attrs.value = this.value;
|
|
} else {
|
|
attrs.value = '';
|
|
}
|
|
|
|
if (this.disabled) {
|
|
attrs.disabled = true;
|
|
}
|
|
|
|
if (this.checked) {
|
|
attrs.checked = true;
|
|
}
|
|
|
|
return attrs;
|
|
}
|
|
})
|