无法从选择选项绑定ng-model

时间:2017-09-19 18:32:48

标签: angularjs drop-down-menu

我正在尝试从select选项传递一个值,以便呈现一个chart.Below是我试图使用的代码。我在下拉列表中获得了所有选项,但是当我选择它时似乎没有通过。



<div>
  <div class="container-fluid">
    <div class="row">
      <div class="col-lg-6">

        <h5>test</h5>

      </div>
      <div class="field-container">
        <!--	style="padding-top: 20px;"-->
        <select class="field col-xs-4" id="dropdown[arrKey]">
          <option ng-repeat="chartsTypeValue in charts.data.chartsType[arrKey]" ng-model="charts.type[chartsTypeValue]">{{chartsTypeValue}} </option>

        </select>
        <!--		<label class="floating-label">Chart Type</label> -->
      </div>
    </div>
  </div>

  <div class="svg-container" ng-if="charts.type[arrKey] =='bar'" style="width: 400px; height: 300px;">
    <bars-chart ng-if="arrValue" chart-data="arrValue"></bars-chart>
  </div>
  <div class="svg-container " ng-if="charts.type[arrKey] =='donuts' " style="text-align: -webkit-center; width: 400px; height: 300px; ">
    <donut-Chart ng-if="arrValue" chart-data="arrValue"></donut-chart>
  </div>
  <div class="svg-container " ng-if="charts.type[arrKey]=='line' " style="width: 400px; height: 300px; ">
    <line-Chart ng-if="arrValue" chart-data="arrValue"></line-chart>
  </div>
  <hr>
</div>
&#13;
&#13;
&#13;

0 个答案:

没有答案