Ng-Mousemove-6

 

In this example of Ng-Mousemove, We have created a scratchbox and on mousemove it will scratch from scratchbox and apply the css. See the code:

 
 
 
<!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"> .Scratchbox { height: 10px; width: 10px; background-color: green; float: left; } </style> </head> <body ng-app="app"> <div ng-controller="myController"> <div class="container"> <div class="row" ng-init="genetareNumbers()"> <div class="col-md-offset-3 col-md-6"> <h2>Scratch the Box on Mouse Move</h2> <div ng-repeat="d in numbers"> <div class="Scratchbox" ng-style="style" ng-mousemove="style={'background-color':'white'}"></div> </div> </div> </div> </div> </div> <script> var app = angular.module("app", []); app.controller('myController', ['$scope', function ($scope) { $scope.numbers = []; $scope.genetareNumbers = function () { for (var i = 1; i < 1167; i++) { $scope.numbers.push(i); }; }; }]); </script> </body> </html>
Output