angularjs - AngularJS v1.8.0 ng-selected 选项不起作用
问题描述
我刚刚将 AngularJs 版本从 AngularJS v1.4.8 更新到 AngularJS v1.8.0,并且我有一个需要默认值的选择。由于某种原因,ng-selected 停止工作。你能告诉我如何在 1.8.0 上设置 ng-selected 吗?(代码使用 ng 模型)
<input name="questionamount" class="form-control uservalue" type="number" min="0" ng-model="userInput1" ng-disabled="content.NotRelevant" ng-blur="setMainFieldAsTouched(); updateFormVisibility()" ng-change="update('userInput1',userInput1)" val-bubble>
<select name="questionperiod" class="form-control" ng-model="userInput2" ng-disabled="content.NotRelevant" ng-blur="setMainFieldAsTouched()" ng-change="update('userInput2',userInput2)" val-bubble>
<option value="">-- Select a period --</option>
<option value="48">Year</option>
<option value="24">6 Months</option>
<option value="12">Quarter</option>
<option value="4" ng-selected="true">Month</option>
<option value="5">Four Weekly</option>
<option value="2">2 Weeks</option>
<option value="1">Week</option>
</select>
<input name="questionvalue" class="form-control" type="number" min="0" readonly ng-required="content.Mandatory && !content.NotRelevant" max="{{content.TriggerLimit}}" ng-change="update('content.Value',content.Value)" ng-blur="updateFormVisibility()" ng-model="content.Value" val-bubble>
</div> ```
Thanks in advance,
Jordi
解决方案
推荐阅读
- typo3 - TYPO3 10:未登录后端时禁用页面
- oracle - Oracle 从另一个电话垂直的表更新电话水平的表
- sql - 使用 hive 中的 spark 将数据推送到 mongoDB
- django - django 一对多多态(注释模型)
- apache-kafka - 如何配置我的连接器以在分布式 kafka 连接的多集群连接环境中的特定工作组中运行?
- apache - Apache + Nginx 服务器与 RTMP 实时流
- java - io.cucumber.core.exception.CucumberException:java.lang.NoClassDefFoundError:io/cucumber/core/internal/gherkin/ast/Node
- bert-language-model - CamembertForSequenceClassification:训练不起作用
- javascript - 承诺链 .then .catch
- css - 如何在使用 *ngFor 创建的 ionic 3 组件中为 css 类变量动态赋值