fix(select): emit the ionSelect option when selecting an option

This commit is contained in:
Brandy Carney
2016-10-21 19:11:02 -04:00
parent f43539ebc7
commit 2eed5e24c2
6 changed files with 32 additions and 7 deletions

View File

@ -145,7 +145,8 @@ export class AlertCmp {
label: input.label,
checked: !!input.checked,
disabled: !!input.disabled,
id: 'alert-input-' + this.id + '-' + index
id: 'alert-input-' + this.id + '-' + index,
handler: isPresent(input.handler) ? input.handler : null,
};
});
@ -237,12 +238,20 @@ export class AlertCmp {
input.checked = (checkedInput === input);
});
this.activeId = checkedInput.id;
if (checkedInput.handler) {
checkedInput.handler(checkedInput);
}
}
}
cbClick(checkedInput: any) {
if (this.enabled) {
checkedInput.checked = !checkedInput.checked;
if (checkedInput.handler) {
checkedInput.handler(checkedInput);
}
}
}