Bind class to ng-class
Description
The following code shows how to bind class to ng-class.
Example
<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.13/angular.js"></script>
<style type='text/css'>
.red {<!-- w ww . j av a 2 s. c om-->
color: red;
}
.blue {
color: blue;
}
</style>
</head>
<body>
<div ng-app>
<button ng-class="myClass"
ng-click="myClass='red'"
ng-init="myClass='blue'">some text</button>
</div>
</body>
</html>