使用ng-repeat从下拉列表

时间:2016-02-17 08:30:23

标签: javascript html angularjs

我想在选择下拉值时重复表格。

下拉列表在表格中。 这是我的代码html



<div class="table-container" ng-repeat="eachVehicleType in schemeInfo.vehicleTypeSchemeList">
  <div class="table-responsive" style="width: 65%;">
<table class="table table-hover table-striped table-bordered table-advanced tablesorter">
  <thead>
  <tr>
    <th>Vehicle Type</th>
    <th>Scheme Amount</th>
    <th>Scheme Percentage</th>
    <th>From Distance</th>
    <th>To Distance</th>

  </tr>
  </thead>
  <tbody>
  <tr>
    <td>
      <md-input-container flex>
        <select ng-model="schemeInfo.vehicleType" ng-change="addVehicleTypeTable() "
                class="form-control select-bottom" style="margin-top: 24px;">
          <option value="">Vehicle Type</option>
          <option value="THREE_WHEELER_OPEN">THREE WHEELER</option>
          <option value="PICK_UP_OPEN">PICK UP</option>
          <option value="MINI_TRUCK_OPEN">MINI TRUCK</option>
        </select></md-input-container>
    </td>

    <td style="padding-top: 31px;padding-left: 19px;"><input style="width: 83px;" ng-model="schemeInfo.schemeAmount"
                                                             type="text" maxlength="4" minlength="1"
                                                             class=" form-control required" required
                                                             ng-pattern="/^[0-9]$/"/></td>

    <td style="padding-top: 31px;padding-left: 19px;"><input style="width: 83px;"
                                                             ng-model="schemeInfo.schemePercentage" type="text"
                                                             maxlength="4" minlength="1"
                                                             class=" form-control required" required
                                                             ng-pattern="/^[0-9]$/"/></td>

    <td style="padding-top: 31px;padding-left: 19px;"><input style="width: 83px;" ng-model="schemeInfo.fromDistance"
                                                             type="text" name="captivereverseBidPrice" maxlength="4"
                                                             minlength="1"
                                                             class=" form-control required" required
                                                             ng-pattern="/^[0-9]$/"/></td>

    <td style="padding-top: 31px;padding-left: 19px;"><input style="width: 83px;" ng-model="schemeInfo.toDistance"
                                                             type="text" maxlength="4" minlength="1"
                                                             class=" form-control required" required
                                                             ng-pattern="/^[0-9]$/"/></td>
  </tr>
  </tbody>
</table>
  </div>
</div>
				    
&#13;
&#13;
&#13;

视图如下 enter image description here

我希望当我从下拉表中选择不同的值时应该重复。

0 个答案:

没有答案