angular.js - How does angularjs elegantly implement an activation style that triggers one of multiple buttons?
世界只因有你
世界只因有你 2017-05-15 17:02:24
0
1
581

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(){
  ··· 
}
世界只因有你
世界只因有你

reply all(1)
刘奇

Little Elegance: demo

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template