【问题标题】:Adding an All Option with ng-options [duplicate]使用 ng-options 添加 All 选项 [重复]
【发布时间】:2014-11-30 21:17:21
【问题描述】:

我目前正在筛选数据集以检索每个唯一名称并将其放入下拉菜单中。

  <select ng-model="Employee" ng-options="order.SPerKey as order.SPerName for order in data.Root.Orders | unique:'SPerKey'"> </select> 

我想在这个下拉菜单中添加一个名为“All”的选项,这样我的下拉菜单就会以 All 选项开头,然后添加过滤后的名称。

【问题讨论】:

    标签: angularjs ng-options


    【解决方案1】:

    只需在select 中包含All 选项

    <select ng-model="Employee" ng-options="order.SPerKey as order.SPerName for order in ata.Root.Orders  unique:'SPerKey'"> 
       <option value="">All</option>
    </select> 
    

    【讨论】:

      猜你喜欢
      • 2014-12-12
      • 1970-01-01
      • 1970-01-01
      • 2014-07-26
      • 1970-01-01
      • 2017-03-31
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多