Javascript 在组合框angularjs中显示数据数组

Javascript 在组合框angularjs中显示数据数组,javascript,angularjs,html,Javascript,Angularjs,Html,我想在组合框中显示来自json对象的数据 <select ng-model="vm.datasource.currencyFormatChoice" ng-options="currencyFormatChoice as currencyFormatChoice for currencyFormatChoice in vm.datasource.currencyFormat"></select> 使用HTML代码,我得到的是[object object],而不是100

我想在组合框中显示来自json对象的数据

 <select ng-model="vm.datasource.currencyFormatChoice" ng-options="currencyFormatChoice as currencyFormatChoice for currencyFormatChoice in vm.datasource.currencyFormat"></select>
使用HTML代码,我得到的是[object object],而不是1000美元。如何将displayValue放入组合框中


亲切的问候

我帮你修好了看看下面的小提琴

    <div ng-app="myapp">
      <fieldset ng-controller="FirstCtrl">
        <select ng-model="modelValue" ng-options="currencyFormatChoice.displayValue for currencyFormatChoice in vm.datasource.currencyFormatChoice"></select>

      </fieldset>
    </div>

var myapp = angular.module('myapp', []);
myapp.controller('FirstCtrl', function($scope) {
$scope.modelValue = {};
      $scope.vm = {
        datasource: {
          currencyFormatChoice: [{
            displayValue: "€ 1.000,00",
            value: "{0:C2}"
          }, {
            displayValue: "€ 1.000",
            value: "{0:C0}"
          }, {
            displayValue: "$ 1,000.00",
            value: "{0:C2}"
          }, {
            displayValue: "$ 1,000",
            value: "{0:C0}"
          }]
        }};
      });

var myapp=angular.module('myapp',[]);
myapp.controller('FirstCtrl',函数($scope){
$scope.modelValue={};
$scope.vm={
数据源:{
货币格式选择:[{
显示值:“€1.000,00”,
值:“{0:C2}”
}, {
显示值:“€1.000”,
值:“{0:C0}”
}, {
显示值:“$1000.00”,
值:“{0:C2}”
}, {
显示值:“$1000”,
值:“{0:C0}”
}]
}};
});

我帮你修好了看看下面的小提琴

    <div ng-app="myapp">
      <fieldset ng-controller="FirstCtrl">
        <select ng-model="modelValue" ng-options="currencyFormatChoice.displayValue for currencyFormatChoice in vm.datasource.currencyFormatChoice"></select>

      </fieldset>
    </div>

var myapp = angular.module('myapp', []);
myapp.controller('FirstCtrl', function($scope) {
$scope.modelValue = {};
      $scope.vm = {
        datasource: {
          currencyFormatChoice: [{
            displayValue: "€ 1.000,00",
            value: "{0:C2}"
          }, {
            displayValue: "€ 1.000",
            value: "{0:C0}"
          }, {
            displayValue: "$ 1,000.00",
            value: "{0:C2}"
          }, {
            displayValue: "$ 1,000",
            value: "{0:C0}"
          }]
        }};
      });

var myapp=angular.module('myapp',[]);
myapp.controller('FirstCtrl',函数($scope){
$scope.modelValue={};
$scope.vm={
数据源:{
货币格式选择:[{
显示值:“€1.000,00”,
值:“{0:C2}”
}, {
显示值:“€1.000”,
值:“{0:C0}”
}, {
显示值:“$1000.00”,
值:“{0:C2}”
}, {
显示值:“$1000”,
值:“{0:C0}”
}]
}};
});
这就成功了

ng-options="currencyFormat as currencyFormat.displayValue for currencyFormat in vm.datasource.currencyFormat"
这就成功了

ng-options="currencyFormat as currencyFormat.displayValue for currencyFormat in vm.datasource.currencyFormat"

谢谢你抽出时间!插入您的解决方案后,我的组合框中仍然会出现[object],谢谢您的时间!插入解决方案后,我的组合框中仍然会出现[object]。