小编Nic*_*ick的帖子

如何将ng-model绑定到ui-select所选项的"值"

请查看以下插件:http://plnkr.co/edit/fc9XcyyYGtAk0aGVV35t?p = preview

  <ui-select ng-model="fm.countryCode" id="countryCode">
      <ui-select-match placeholder="Select a country...">{{$select.selected.label}}</ui-select-match>
      <ui-select-choices repeat="item in countries | filter: $select.search" value="{{$select.selected.value}}">
          <div ng-bind-html="item.label | highlight: $select.search"></div>
          <small ng-bind-html="item.value | highlight: $select.search"></small>
      </ui-select-choices>
  </ui-select>   
Run Code Online (Sandbox Code Playgroud)

我正在尝试使用ui-select将fm.countryCode设置为所选项的值.目前它只是将fm.countryCode设置为整个国家/地区项目.例如,如果我选择阿富汗,fm.countryCode将设置为{"value":"AF","label":"Afghanistan"}.我想要的是"AF".

我是否必须设置$ watch来实现这一目标,还是有更优雅的解决方案?

angularjs

1
推荐指数
1
解决办法
6197
查看次数

有没有什么理由可以选择Adobe ColdFusion而不是Railo?

我个人想不到一个,但我真诚地希望听到任何认为Adobe ColdFusion仍然物有所值的人.

coldfusion railo

0
推荐指数
1
解决办法
161
查看次数

标签 统计

angularjs ×1

coldfusion ×1

railo ×1