0
以下は私のコードです.3つの入力とビューボタンがあり、ここでビューをクリックするとサーバーからデータが取得されます。 3つの入力はCustomer、Date、Shiftです。私は、この3つの入力をng-repeatで保持しています。得意先= 1は、顧客入力用NG-モデルはNG-モデルのためにも1ng-repeat問題のng-modal
<div ng-repeat = "x in CustomerList">
<form class="form-horizontal" ng-submit="getproductiondetails()">
<div class="form-group">
<div class="row">
<div class="input-group">
<span class="input-group-addon"><i class="fa fa-users"></i></span>
<select required class="form-control" ng-value= "x.customerID" ng-model="data.CustomerID">
</select>
</div>
<div class="input-group">
<span class="input-group-btn">
<button type="button" class="btn btn-default" ng-click="open1()"><i class="glyphicon glyphicon-calendar"></i></button>
</span>
<input type="text" class="form-control" uib-datepicker-popup="dd-MMM-yyyy" ng-model="data.ProductionReportDate" is-open="popup1.opened" required close-text="Close" />
</div>
<div class="input-group">
<span class="input-group-addon"><i class="fa fa-mars"></i></span>
<select required class="form-control" ng-model="data.ShiftTypeID">
<option value="">Shift</option>
<option ng-repeat="y in shiftList" value="{{y.ShiftTypeID}}">{{y.ShiftTypeName}}</option>
</select>
</div>
</div>
<div class="row">
<div class="col-md-2 pull-left">
<button type="submit" class="btn btn-primary">View</button>
</div>
</div>
</div>
</form>
</div>
しかし、ここであれば、顧客の入力では、得意先の値に選択されていません。 ng-repeatからcustomerIDの値を選択するための入力方法CUSTOMERLISTで
サンプルデータ:
- 得意= 1、のCustomerName = KL
- 得意= 2、
サンプルデータShiftListでのCustomerName = JK:
- ShiftID = 1、ShiftName = 1stシフト
- ShiftID = 2、ShiftName = 2ndシフト
申し訳ありませんが、角度が – Ranger
「ng-model =」data.ShiftTypeID「 ''の代わりに 'ng-model =" x.ShiftTypeID "'にする必要がありますか?そして、同じリピーターエイリアス名( 'ng-repeat =" xはオプションで、 'ng-repeat =" xはCustomerList "( –
) 'と' ng-repeat = "x of shiftList"は、おそらく好きではない変数 'x'を共有します –