Skip to content

Commit

Permalink
fix(select): return undefined when there are no options (#11968)
Browse files Browse the repository at this point in the history
* fix(select): make select with no options return undefined when OK is pressed (#10435)

* refactor(select): add early check for alert inputs

fixes #10435
  • Loading branch information
zakton5 authored and manucorporat committed Jun 8, 2017
1 parent 305c306 commit dc6c586
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/components/alert/alert-component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,11 @@ export class AlertCmp {
return this.d.inputs.filter(i => i.checked).map(i => i.value);
}

if (this.d.inputs.length === 0) {
// this is an alert without any options/inputs at all
return undefined;
}

// this is an alert with text inputs
// return an object of all the values with the input name as the key
const values: {[k: string]: string} = {};
Expand Down

0 comments on commit dc6c586

Please sign in to comment.