in one of the following forms:
- for array data sources:
label
for
value
in
array
select
as
label
for
value
in
array
label
groupby
group
for
value
in
array
select
as
label
groupby
group
for
value
in
array
trackby
trackexpr
- for object data sources:
label
for(
key
,
value
)in
object
select
as
label
for(
key
,
value
)in
object
label
groupby
group
for(
key
,
value
)in
object
select
as
label
groupby
group
for
(
key
,
value
)in
object
Where:
array
/object
: an expression which evaluates to an array / object to iterate over.value
: local variable which will refer to each item in thearray
or each property value ofobject
during iteration.key
: local variable which will refer to a property name inobject
during iteration.label
: The result of this expression will be the label for<option>
element. Theexpression
will most likely refer to thevalue
variable (e.g.value.propertyName
).select
: The result of this expression will be bound to the model of the parent<select>
element. If not specified,select
expression will default tovalue
.group
: The result of this expression will be used to group options using the<optgroup>
DOM element.trackexpr
: Used when working with an array of objects. The result of this expression will be used to identify the objects in the array. Thetrackexpr
will most likely refer to thevalue
variable (e.g.value.propertyName
).