vendredi 13 janvier 2023

How to select the multiple checkbox

I have to select the multiple checkboxes but every time i click the button it takes only once and comes back to button.

 <div class="dropdown-menu mselect" aria-labelledby="dropdownMenuButton">
                                        <div class="dropdown-item " ng-repeat="tagitem in distinctTags">
                                          <div style="margin-right:10px;" ng-click="addRemoveTag(tagitem)" ng-class="isActive(tagitem) ? 'selectedStudent' : 'notSelectedStudent'"></div>
                                          <span class="multi"ng-click="addRemoveTag(tagitem)" ></span>
                                        </div>                                        
                                       </div>
                                    </div>

js

 $scope.addRemoveTag = function(tagitem){
       
        if ($scope.selectedTags.includes(tagitem)){
            $scope.selectedTags = $scope.selectedTags.filter(item => item !== tagitem);
            
            
        }
        else{
            
            $scope.selectedTags.push(tagitem);
            
        }
       
        
    }

i want to select multiple checkbox and send those values to addRemoveTag function




Aucun commentaire:

Enregistrer un commentaire