我想在单击按钮时动态更改下拉选项
HTML 代码
<ul data-role="listview" data-inset="true">
<li ng-controller="exerciseTypeCtrl">
<select id="exerciseType" data-role="listview" ng-options="type as type.text for type in types.cast " ng-model="item" ng-change="update()">
</select>
</li>
</ul>
使用这个 JS
var myApp = angular.module('myApp',[]);
myApp.controller('exerciseTypeCtrl',function($scope,indoors,outdoors)
{
$scope.types = indoors;
$scope.update = function() {
}
});
默认情况下,我绑定数据indoors
,并且我想outdoors
在 ng-click 事件上绑定数据,因此动态下拉更新我需要有关此问题的帮助