码迷,mamicode.com
首页 > Web开发 > 详细

AngularJS select中ngOptions用法详解

时间:2015-11-08 16:31:52      阅读:463      评论:0      收藏:0      [点我收藏+]

标签:

参数说明                                                                                                                          

 

in one of the following forms:

 

  • for array data sources:
    • 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 track bytrackexpr
  • for object data sources:
    • 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. Theexpression 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.
  • trackexpr: Used when working with an array of objects. The result of this expression will be used to identify the objects in the array. The trackexpr will most likely refer to the value variable (e.g. value.propertyName).

 

AngularJS select中ngOptions用法详解

标签:

原文地址:http://www.cnblogs.com/laixiangran/p/4947513.html

(1)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!