如何禁用角度选择下拉列表

Paw*_*wan 2 twitter-bootstrap angularjs

我想禁用角度选择下拉列表.实际上我想限制少数用户的访问权限.代码链接:http://plnkr.co/edit/mGnpQynWKkRLBC0VEHBR?p = preview

all*_*lle 5

在控制器中添加:

$scope.isDisabled = false; // change to true to disable the multiselect
Run Code Online (Sandbox Code Playgroud)

然后,视图应该是(查看disabled属性):

<multiselect class="input-xlarge" multiple="true"
    ng-model="selectedCar"
    options="c.name for c in cars"
    change="selected()" disabled="isDisabled"></multiselect>
Run Code Online (Sandbox Code Playgroud)

最后,添加适当的逻辑以在控制器中设置$ scope.isDisabled.