Friday, October 13, 2017

Checkbox in dropdown menu is not checked from previously selected value in AngularJS

I am new to AngularJS. I am trying to get the checkbox to appear as checked from previously selected value. I thought ng-class would do the trick but it’s not. Did I do anything wrong in the code below?

Here is my HTML code:

<ul class="dropdown-menu menu-content" uib-dropdown-menu>
      <li ng-repeat="value in values" >
      <label><input type="checkbox" ng-class="{'checked' : value.selected, 'active' : value.selected}" ng-click="$ctrl.toggleValue(value)"></label></li>
</ul>

Source: AngularJS



from Angular Questions https://angularquestions.com/2017/10/13/checkbox-in-dropdown-menu-is-not-checked-from-previously-selected-value-in-angularjs/
via @lzomedia #developer #freelance #web #lzomedia.com

No comments:

Post a Comment