angular.js ng-click点击事件切换类
<!DOCTYPE html>
<html>
<head>
<style>
.c {padding: 20px;background: #00adff;}
.a {background: #43dd31;}
.b {border: 5px dashed yellow;}
</style>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.23/angular.min.js"></script>
</head>
<body>
<div ng-app="">
<div class="c" ng-class="{'a': toggle, b: secondToggle}">
<button ng-click="toggle = !toggle">Toggle</button>
<button ng-click="secondToggle = !secondToggle">Second Toggle</button>
</div>
</div>
</body>
</html>