0
嗨,下面是我的選擇下拉列表的HTML代碼。無法在角JS中設置選定的選項?
<div class="panelProfileDefault col-md-11" ng-repeat="profile in allPanelData">
<form name="updateProfile" class="setProfile" ng-submit="updateProfile(updateProfile)" novalidate>
<div class="modal-body col-md-10">
<div class="form-group col-md-5" ng-class="{ 'has-error' : updateProfile.profileName.$invalid && updateProfile.profileName.$dirty}">
<div class="col-sm-12 col-md-12">
<input type="text" class="" id="profileName" name="profileName" ng-model="profile.Name" placeholder="Element" required ng-disabled="isDisabled"/>
<div ng-messages='setProfile.profileName.$error' ng-if='submitted || setProfile.profileName.$dirty'>
<div ng-message='required' class="has-error">Please Enter the value for this field</div>
</div>
</div>
</div>
<div class="form-group col-md-5" ng-class="{ 'has-error' : setProfile.profileType.$invalid && setProfile.profileType.$dirty}">
<div class="col-sm-12 col-md-12">
<select class="transparent-textbox" ng-model="profile.TypeID" name="profileType" required ng-disabled="isDisabled">
<option value="0" disabled>Element Type</option>
<option value="1">Text</div>
<option value="2">Float</div>
<option value="3">Date</div>
<option value="4">Object</div>
<option value="5">Long</div>
</select>
<div ng-messages='setProfile.profileType.$error' ng-if='submitted || setProfile.profileType.$dirty'>
<div ng-message='required' class="has-error">Please select the profileType</div>
</div>
</div>
</div>
</div>
</form>
</div>
我在做什麼是點擊一些div我打電話一個API並獲取數據作爲響應。
$http.get(__env.apiUrl+'/UserPanelPanellists/GetProfileVariables?panelID=' + panelId, {
headers: { 'Content-Type': 'application/json','SessionID':$rootScope.token}
}).then(function(success){
console.log(success.data);
$scope.allPanelData = success.data;
$scope.$emit('unload');
},function(http, status, fnc, httpObj){
$scope.$emit('unload');
console.log('data retrieval failed.',http,status,httpObj);
});
但現在無法顯示在IE中選擇下拉列表中的數據如果與值=「1」 $scope.allPanelData.TypeID =1
然後選擇選項應該得到選擇同他人也
當我安慰$ scope.allPanelData它看起來像這樣。
如何解決呢?