I have a list of buttons that can be clicked. When no buttons are selected, I want to disable a button somewhere else.
Here is the button, the class is added from this code -
<button type="button" ng-repeat="service in services_data track by service.id" ng-class="showDetails[service.id] ? 'bg-success': 'bg-default'" ng-init="selected[service.id] = false" ng-click="showDetails[service.id] = showDetails[service.id]; select_check(showDetails)" class="list-group-item item_buttons">
<ul class="list-unstyled">
<li>{{service.name}} - {{service.est_time_mins}} mins. | ${{service.price}}</li>
<li>{{service.style}}</li>
</ul>
</button>
When a button is clicked, it triggers a toggle variable "showDetails"...this returns TRUE when a button is selected and FALSE if it is deselected.
So when all the buttons are in the FALSEy state, I want a button disabled.
So, I can I write a function that checks the showDetails variable for each button?
Tried a bunch of stuff with loops, looping over each button and some if/elses but I could not get anything working correctly even close really.