html - disable a menu item in Angular uib-dropdown -


in angular template i'm creating dropdown menu using angular-ui, need disable of list items based on property of "company" object defined in ng-repeat.

i tried disabled tag or ng-disabled directive without success. how can achieve that?

my current code:

<div class="btn-group" uib-dropdown is-open="dropdown-open">     <button id="companydropdown" type="button" class="btn btn-default"      uib-dropdown-toggle>          {{companydescr}}<span class="caret"></span>     </button>     <ul class="dropdown-menu" uib-dropdown-menu role="menu"      aria-labelledby="companydropdown">         <li role="menuitem" ng-repeat="company in companycontracts">             <a ng-click="selectcontract(company)">{{company.address}}</a>         </li>     </ul> </div> 

any appreciated!

you use disabled class bootstrap ng-class directive angular.

html

 <ul class="dropdown-menu" uib-dropdown-menu role="menu" aria-labelledby="companydropdown">     <li  ng-class="{'disabled': company.disabled }" role="menuitem" ng-repeat="company in companycontracts">         <a ng-click="selectcontract(company)">{{company.address}}</a>     </li> </ul> 

edit

according bootstrap documentation, disabled class must applied <li> element.


Comments

Popular posts from this blog

java - Static nested class instance -

c# - Bluetooth LE CanUpdate Characteristic property -

JavaScript - Replace variable from string in all occurrences -