gpt4 book ai didi

angularjs - ng-selected 不适用于选择框中的 ng-model - Angularjs

转载 作者:行者123 更新时间:2023-12-03 18:23:18 26 4
gpt4 key购买 nike

<分区>

虽然 ng-model 用于选择框,而 ng-selected 也用于选项,但在某些情况下 time ng-selected 不起作用。

如果我将删除 ng-model 而不是 ng-selected 正在工作,但是如果我将删除 ng-model 而不是我应该如何在 Controller 中获取选择框的值。

请帮忙!

这是我的代码...

HTML:

<select class="form-control" ng-change="accessModeSelected()">
<option ng-selected="mode.status == '1'" ng-repeat="mode in storageResult.accessMode" ng-value="mode.name" name="accessMode{{$index}}" id="accessMode">
{{mode.name}}
</option>
</select>

AngularJS:

$scope.storageResult   = {
"storageAccount":"Enable",
"user": "sdcard",
"pass": "sdcard",
"wifiIP": "0",
"ipAddr": "0",
"accessMode": [
{"name": "Local Storage","status": "0"},
{"name":"WiFi Storage", "status": "1"},
{"name":"Internet Storage", "status": "0"}
]
}

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com