基本上,我试图填充一个选择框,但连接的值从first_name列和last_name列。
我想做什么(不工作):
<select ng-model="buyers" ng-options="b.id as (b.first_name + " " + b.last_name) for b in buyers"></select>
什么工作:
<select ng-model="buyers" ng-options="b.id as b.first_name for b in buyers"></select>
引号很重要。它不会使用双引号内的双引号或单引号内单引号。
原文链接:https://www.f2er.com/angularjs/146556.html什么工作:
<select ng-model="buyers" ng-options='b.id as (b.first_name + " " + b.last_name) for b in buyers'></select>