0
içinde düzenleme modu üzerindeki değeri ve metin için doldurulmuş bir damla ayarlamak nasıl Bu değeri düzenlemek ve düzenleme görünümü üzerinde metin ayarlamak istiyorum, ancak doldurulmuş diğer tüm metin dışında ayarlanırAngularJS ve asp.net webApi
bu aşağı açılan html parçası
//Html content
<select class="form-control" id="pcategory" ng-model="pcategory" ng-options="c.CID as c.Name for c in pcategoryA">
<option value="">-- Select Category --</option>
</select>
<input type="text" class="form-control" id="name" ng-model="name" />
<input type="text" class="form-control" id="price" ng-model="price" />
<input type="text" class="form-control" id="quantity" ng-model="quantity" />
// angularJS
$http.get('/api/product/' + $routeParams.id).success(function (data)
{
$scope.pcategory = data.CID, // I cannot set the drop down
$scope.name = data.name,
$scope.price = data.price,
$scope.quantity = data.quantity
});
önceden
sayesinde !!
değeri Evet yerine her zaman bir değer eşleşmesi "pcategoryA" içindedir data.CID –
Bu hile $ scope.pcategory = "" + data.CID + "" ama don ile bunu çözmek başardı büyünün nasıl olduğunu bilmiyorum. –