Ng-DoubleClick-7

 

In this example if we double click on the text it will change the color of text because true value is assigned to ng-class and vice versa.

 
 
 
<!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <style type="text/css"> .red { color: red; } </style> <title>Welcome to LearnKode - A code learning platform</title> <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.2/angular.min.js"></script> </head> <body ng-app> <div> <p ng-dblclick="isColor=!isColor" ng-class="{red:isColor}">Double-click me to change my text color.</p> </div> </body> </html>
Output