2
我用數據填充從Web API來一個選擇多,但我想顯示另一個查詢所選的值,它不工作Angularjs選擇多個選項不工作
型號
$scope.clickevent = function (id, name) {
$scope.id = id
$scope.fleetFeatures = fleetFeatures.list;
$http.get(myUrl + "FleetFeatures/Selected?id_fleet=" + $scope.id).then(function (data) {
$scope.selectedFeatures = data.data;
});
}
查看
<div class="input-field col s12">
<select class="" id="features" ng-model="selectedFeatures" ng-options="item.FleetFeatureId as item.FleetFeatureName for item in fleetFeatures" multiple material-select watch>
<option value="" disabled selected>{{translation.fleet5}}</option>
</select>
</div>
fleetFeatures
[{"$id":"1","Fleet_FleetFeatures":[],"FleetFeatureId":1,"FleetFeatureName":"Advanced Geocoding Features","FleetFeatureCode":1,"FleetFeatureData":null},{"$id":"2","Fleet_FleetFeatures":[],"FleetFeatureId":2,"FleetFeatureName":"feature 2","FleetFeatureCode":2,"FleetFeatureData":null},{"$id":"3","Fleet_FleetFeatures":[],"FleetFeatureId":3,"FleetFeatureName":"feature 3","FleetFeatureCode":672,"FleetFeatureData":null}]
個
selectedFeatures
[{"$id":"1","FleetFeatureId":3},{"$id":"2","FleetFeatureId":1}]
我缺少的代碼什麼的,因爲我選擇加載它,但它並沒有顯示我選擇
感謝任何提前
=)...你一直很快。 – lin