小编Pat*_*url的帖子

是否可以在Angular ng-options中连接值

基本上,我正在尝试填充选择框,但从first_name列和last_name列连接值.

我想做什么(不起作用):

<select ng-model="buyers" ng-options="b.id as (b.first_name + " " + b.last_name) for b in buyers"></select>
Run Code Online (Sandbox Code Playgroud)

什么工作:

<select ng-model="buyers" ng-options="b.id as b.first_name for b in buyers"></select>
Run Code Online (Sandbox Code Playgroud)

angularjs angularjs-ng-options

71
推荐指数
1
解决办法
4万
查看次数

标签 统计

angularjs ×1

angularjs-ng-options ×1