Ng-Mouseleave-5

 

Array of object elements shown using ng-repeat directive.On mouse leave event hoverEdit variable value is false which is assign to ng-show directive means Edit link is hide when we leave mouse from element.

 
 
 
<!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> </head> <body ng-app="app"> <div ng-controller="controllerName"> <b>Mouse Leave event</b><br /> <div ng-repeat="task in tasks" ng-mouseover="hoverEdit=true" ng-mouseleave="hoverEdit=false"> {{task.name}} <span ng-show="hoverEdit"> <a href="javascript:void(0)"><b>Edit</b></a> </span> </div> </div> <script> var app = angular.module("app", []); app.controller('controllerName', ['$scope', function ($scope) { $scope.tasks = [{ name: 'Angular' }, { name: 'Bootstrap' }, { name: 'JQuery' }, { name: 'JavaScript' }] }]); </script> </body> </html>
Output