Ng-Mousedown-6

 

On ng-mousedown event style of mousedown will apply on div element that is green color and white text and other style will apply on mouseup event.

 
 
 
<!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title></title> <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.2/angular.min.js"></script> <link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css"> <style type="text/css"> .mousedown { background-color: darksalmon; } </style> </head> <body ng-app="app"> <div ng-controller="controllerName"> <div class="container"> <br /> <div class="row"> <div class="col-md-12 "> <div class="mousedown well" ng-style="style" ng-mousedown="style={'background-color':'plum','color':'kyan'};val='fired.'" ng-mouseup="style={'background-color':'tomato','color':'gray'};val=' will fire'"><h3>Mouse down event {{val}}</h3></div> </div> </div> </div> </div> <script> var app = angular.module("app", []); app.controller('controllerName', ['$scope', function ($scope) { }]); </script> </body> </html>
Output