Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to disable the angular select dropdown

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

like image 475
Pawan Avatar asked Apr 15 '26 01:04

Pawan


1 Answers

In controller add:

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

Then, the view should be (look at the disabled attribute):

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

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

like image 76
alle Avatar answered Apr 18 '26 02:04

alle



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!