As shown in the picture, there are three buttons. Click any one of them and the button will turn into a blue background, and the other two buttons will return to the default white color
<button type="button" class="btn" ng-click='toggle()' ng-class='active'>按钮1</button>
<button type="button" class="btn " ng-click='toggle()'>按钮2</button>
<button type="button" class="btn " ng-click='toggle()'>按钮3</button>
In controller:
$scope.toggle=function(){
···
}
Little Elegance: demo