我的视图中有这 2 个选择选项,我需要在禁用它之前将第二个选择值设置为“原始”
<div class="form-group">
<label>Download mode:</label>
<select ng-model="properties.DownloadMode.PropertyValue" ng-change="EnableDisableDownloadFilePresets(properties.DownloadMode.PropertyValue)" class="form-control">
<option value="download" selected> Direct Download</option>
<option value="link"> Canto Link</option>
</select>
</div>
<div class="form-group">
<label>Download presets</label>
<select ng-model="properties.DownloadFilePresets.PropertyValue" ng-disabled="DownloadFilePresetsIsDisabled" class="form-control">
<option value="original" selected> Original</option>
<option value="all"> All file presets</option>
</select>
</div>
这是我的功能
$scope.EnableDisableDownloadFilePresets = function (selectedValue) {
console.log(selectedValue);
if (selectedValue === "link") {
// set Download presets value to "original"
// disable Download presets
$scope.DownloadFilePresetsIsDisabled = true;
} else {
// enable Download presets
$scope.DownloadFilePresetsIsDisabled = false;
}
}