Trying to create some very basic functionality which basically makes two buttons behave like radio buttons. Have two buttons that are used to show/hide different content based on what is shown. So it is working as expected except for it is changing on any click. So if I click the same button twice then it changes the class. I only need it to change if the other button is clicked:
<button class="someClass" ng-class="{true: 'green', false: 'blue'} [!yupNope.isSelected]" ng-click="yupNope.isSelected = !yupNope.isSelected">YES</button>
<button class="someClass" ng-class="{false: 'green', true: 'yupNope'}[!yupNope.isSelected]" ng-click="yupNope.isSelected = !yupNope.isSelected">NO</button>
So if Yes is clicked then it should update and No should too. But if Yes is clicked again before No is clicked then there should be no change.
Here is a Plunkr to play with:
yupNope.isSelected = !yupNope.isSelected