如何禁用角度选择下拉列表 [英] How to disable the angular select dropdown

查看:118
本文介绍了如何禁用角度选择下拉列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要禁用角度选择下拉列表。其实我想对于限制几个用户的访问。
code链接: http://plnkr.co/edit/mGnpQynWKkRLBC0VEHBR?p= preVIEW

I want to disable the angular select dropdown. Actually I want restrict the access for few users. Code link:http://plnkr.co/edit/mGnpQynWKkRLBC0VEHBR?p=preview

推荐答案

在控制器添加:

$scope.isDisabled = false; // change to true to disable the multiselect

然后,认为应该是(看的停用的属性):

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

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

Finally, add the proper logic to set the $scope.isDisabled in your controller.

这篇关于如何禁用角度选择下拉列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆