From 38de268f26d538b51d38e20d60ca7d49e9bd853a Mon Sep 17 00:00:00 2001 From: William Wallace Date: Thu, 1 Dec 2016 23:55:13 -0800 Subject: [PATCH] Add id attribute and value set from Input Options https://github.com/driftyco/ionic/issues/9457 --- src/components/alert/alert-component.ts | 4 ++-- src/components/alert/alert.ts | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/components/alert/alert-component.ts b/src/components/alert/alert-component.ts index 8e542e88a6e..406e08ca7fb 100644 --- a/src/components/alert/alert-component.ts +++ b/src/components/alert/alert-component.ts @@ -50,7 +50,7 @@ import { ViewController } from '../../navigation/view-controller'; '' + @@ -153,7 +153,7 @@ export class AlertCmp { label: input.label, checked: !!input.checked, disabled: !!input.disabled, - id: `alert-input-${this.id}-${index}`, + id: `alert-input-${input.id}-${index}`, handler: isPresent(input.handler) ? input.handler : null, }; }); diff --git a/src/components/alert/alert.ts b/src/components/alert/alert.ts index d57b2eef070..6be04fc72f8 100644 --- a/src/components/alert/alert.ts +++ b/src/components/alert/alert.ts @@ -126,7 +126,9 @@ export class Alert extends ViewController { * inputs. Do note however, different types of "text"" inputs can be mixed, * such as `url`, `email`, `text`, etc. If you require a complex form UI * which doesn't fit within the guidelines of an alert then we recommend - * building the form within a modal instead. + * building the form within a modal instead. When using the `id` option, please + * note the value of `id` will be written to the DOM as `alert-input-[id]-[index]`, + * where index is the index of the input option. * * * @usage @@ -231,7 +233,7 @@ export class Alert extends ViewController { * | value | `string` | The input's value. | * | label | `string` | The input's label (only for radio/checkbox inputs) | * | checked | `boolean` | Whether or not the input is checked. | - * | id | `string` | The input's id. | + * | id | `string` | The input's id.(written to the DOM as alert-input-{id}-{index}) | * * Button options *