Ng-select在angularjs中不起作用
ng-select is not working in angularjs?
我在angular js的下拉菜单中遇到了一些问题。下面是html代码
<select class="form-control" ng-init="projectName = options[0]" ng-model="projectName" name="projectName" ng-options="project.name for project in projectsList track by project.id" ng-class="{'submitted': submitted}" ng-selected="projectName" required>
<option value="">Select Project</option>
</select>
一切都好。
但是我想要的是从下拉表中选择值后,我们提交了表单,并成功地获得了我所选择的值。现在我想为下拉菜单设置这个值,怎么做呢?
在jquery中可以
$("dropdown").val('successCallBackValue');
但是在angular中怎么做
表单提交成功后,只需将下拉模型值中的值设置为,
$scope.projectName = yourValue; // whatever selected value you are getting.
<select class="form-control" ng-init="projectName = options[0]" ng-model="projectName" name="projectName" ng-options="project.name for project in projectsList track by project.id" ng-class="{'submitted': submitted}" required>
<option value="">Select Project</option>
</select>
相关文章:
- 我的AngularJS表达式没有'不起作用
- AngularJS指令部分应用的函数don'不起作用
- AngularJS ng include dons'不起作用
- AngularJs和Laravel的Pretty Urls不起作用
- Google Maps API OverlayView()在AngularJS指令中不起作用
- AngularJS ng include won'不知什么原因不起作用
- AngularJS没有'不起作用
- Grunt concat js angularjs 不起作用
- angularjs ng点击运行时标记不起作用
- AngularJS:$on dons'不起作用
- AngularJS-简单的教程不起作用
- 输入类型范围在angularjs重复内不起作用
- 数据绑定在特定情况下不起作用(AngularJS)
- 路由不起作用 AngularJS,只是添加一个哈希
- 在 jsfiddle 中拖放表中的行不起作用 - angularjs
- 提交按钮不起作用 AngularJS
- $location.search() 不起作用 - AngularJs 1.5
- 单击按钮时获取单选按钮值不起作用angularjs
- Ng-repeat不起作用AngularJs
- 提交指令不起作用 AngularJS