Execute
<!DOCTYPE html> <html> <head> <title>Wikitechy AngularJS Tutorials</title> <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.5.6/angular.min.js"> </script> <style> .blue { color:blue; } .font { font-size:20px; } .orange { background-color:orange; } </style> </head> <body ng-app=""> <h3>Choose a class from the below checkbox:</h3> <input type="checkbox" ng-model="fontsize"> Font Size<br> <input type="checkbox" ng-model="bluecolor"> Blue Color<br> <input type="checkbox" ng-model="orangecolor"> Orange Color Background <div ng-class="{blue:bluecolor,font:fontsize,orange:orangecolor}"> <h1>Wikitechy ng-class Directive in AngularJS!</h1> </div> </body> </html>
www.wikitechy.com © Copyright 2016. All Rights Reserved.