Skip to content

Commit a9dd3c7

Browse files
committed
MERGE: ng:options
1 parent 650206e commit a9dd3c7

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

src/widgets.js

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -541,11 +541,12 @@ angularWidget('button', inputWidgetSelector);
541541
* @name angular.directive.ng:options
542542
*
543543
* @description
544-
* Replace this whole paragraph with:
545-
*
546544
* Dynamically generate a list of `<option>` elements for a `<select>` element using the array
547545
* obtained by evaluating the `ng:options` expression.
548546
*
547+
* When an item in the select menu is select, the array element represented by the selected option
548+
* will be bound to the model identified by the `name` attribute of the parent select element.
549+
*
549550
* Optionally, a single hard-coded `<option>` element, with the value set to an empty string, can
550551
* be nested into the `<select>` element. This element will then represent `null` or "not selected"
551552
* option. See example below for demonstration.
@@ -554,14 +555,20 @@ angularWidget('button', inputWidgetSelector);
554555
* of {@link angular.widget.@ng:repeat ng:repeat}. `ng:repeat` is not suitable for use with
555556
* `<option>` element because of the following reasons:
556557
*
557-
* * `option` value attribuet requires a string, where as the array we are trying to unroll is
558-
* composed of objects.
558+
* * value attribute of the option element that we need to bind to requires a string, but the
559+
* source of data for the iteration might be in a form of array containing objects instead of
560+
* strings
559561
* * {@link angular.widget.@ng:repeat ng:repeat} unrolls after the select binds causing
560562
* incorect rendering on most browsers.
561563
* * binding to a value not in list confuses most browsers.
562564
*
563565
* @element select
564-
* @param {comprehension_expression} comprehension _expresion_ `for` _item_ `in` _collection_.
566+
* @param {comprehension_expression} comprehension _expresion_ `for` _item_ `in` _array_.
567+
*
568+
* * _array_: an expression which evaluates to an array of objects to bind.
569+
* * _item_: local variable which will reffer to the item in the _array_ during the itteration
570+
* * _expression_: The result of this expression will is `option` label. The
571+
* `expression` most likely reffers to the _item_ varibale.
565572
*
566573
* @example
567574
<doc:example>

0 commit comments

Comments
 (0)