<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>What is ng-mouseover directive? Why we use it?</title>
<script src="https://code.angularjs.org/1.4.1/angular.js"></script>
<script>
var app = angular.module('myApp', []);
app.controller('ngClickCtrl', function ($scope) {
$scope.firstName = "Anil";
$scope.lastName = "Singh";
$scope.IsActive = false;
$scope.mouseover = function (IsActive) {
if (!IsActive) {
$scope.IsActive = true;
} else {
$scope.IsActive = false;
}
};
});
</script>
</head>
<body ng-app="myApp">
<div ng-controller="ngClickCtrl">
<div>
First Name:
<input type="text" ng-model="firstName"> Last Name:
<input type="text" ng-model="lastName">
<button ng-mouseover="mouseover(IsActive)">NG-MOUSEOVER </button>
</div>
<div>
<div ng-show="IsActive"> <h3>Full Name: {{firstName + " " + lastName}} </h3></div>
</div>
</div>
</body>
</html>
// Code goes here
/* Styles go here */