label
for
value
in
array
label
for
value
in
array
label
group by
group
for
value
in
array
select
as
label
for
value
in
array
select
as
label
for
value
in
array
select
as
label
for
value
in
array
以下是 AngularJS API 的 ngOptions 參數說明: http://docs.angularjs.org/api/ng.directive:select
ngOptions(optional) – {comprehension_expression=} –
in one of the following forms:
label
for
value
in
array
select
as
label
for
value
in
array
label
group by
group
for
value
in
array
select
as
label
group by
group
for
value
in
array
label
for (
key
,
value
) in
object
select
as
label
for (
key
,
value
) in
object
label
group by
group
for (
key
,
value
) in
object
select
as
label
group by
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 the array
or each property value
of object
during iteration.key
: local variable which will refer to a property name in object
during iteration.label
: The result of this expression will be the label for <option>
element. The
expression
will most likely refer to the value
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 to value
.group
: The result of this expression will be used to group options using the <optgroup>
DOM element.