1
       <tbody md-body>
          <tr md-row md-select="dessert"  md-select-id="name" ng-model="participant.partName" md-auto-select ng-repeat="participant in participants track by participant.partName | filter: search">
            <td md-cell>{{participant.partName}}</td>

            <td md-cell><img src="./images/mute.png" ng-click="mutePart(participant.partName);" title="Mute" 
                                ng-class="{'selected-image' : participant.partName === muteSelected}" /></td>
            <td md-cell><img src="./images/unmute.png"  ng-click="unmutePart(participant.partName);" title="Unmute" 
                                ng-class="{'selected-image' : participant.partName === unmuteSelected}"/></td>                  

          </tr>
        </tbody>

JS:

$scope.mutePart = function(muteSelected) {         
  $scope.muteSelected = muteSelected;
  $scope.unmuteSelected = null;
  $rootScope.muteInd = true;
  $rootScope.muted = true;

}

$scope.unmutePart = function(unmuteSelected) {
  $scope.unmuteSelected = unmuteSelected;
  $scope.muteSelected = null;
  $rootScope.mutInd = false;
  $rootScope.muted = false;
}

CSS: .selected-image { border: 1px solid red; }

I have mute, unmute image buttons for various endpoints. For the 1st endpoint, you click on mute, it gets selected but if you click on mute of 2nd endpoint the previously selected mute of 1st endpoint is not selected anymore. I want to keep all the clicked buttons of mute or unmute to be highlighted.. Currently only 1 button gets selected on click.

Anuja Patil
  • 47
  • 1
  • 10

0 Answers0