Ng-Mouseenter-5

 

Bydefault value of textbox is LearnIt which is bind to mouseEnter variable with ng-model directive.On mouse enter event text of textbox changes to visrosoftware because at that time mouseEnter variable value is visrosoftware and on mouse leave it becomes LearnIt.

 
 
 
<!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"> Mouse Enter: <input type="text" ng-mouseenter="mouseEnter='Visrosoftware'" ng-mouseleave="mouseEnter='LearnIt'" ng-model="mouseEnter" /> </div> <script> var app = angular.module("app", []); app.controller('controllerName', ['$scope', function ($scope) { $scope.mouseEnter = 'LearnIt'; }]); </script> </body> </html>
Output