Ng-Blur-4

 

In this example of Ng-Blur, We have added a checkbox and onblur of checkbox, it will show alert box with some message$scope.alert = function () { alert("This Check box field has lost its focus."); } See the output

 
 
 
<!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"> </head> <body ng-app="app"> <div class="container"> <div ng-controller="LearnKode"> <div class="row"> <label class="col-md-2">Admin:</label> <div class="col-md-2"> <input type="checkbox" ng-blur="alert()"> </div> </div> </div> </div> <script> var app = angular.module("app", []); app.controller('LearnKode', ['$scope', function ($scope) { $scope.alert = function () { alert("This Check box field has lost its focus."); } }]); </script> </body> </html>
Output