In this example of Ng-Blur, We have a textbox with ng-blur that will increment the count and set the isBlur variable to true. Based on the the on blur the textbox color will be changed. See the output

<!DOCTYPE html> <html xmlns=""> <head> <title></title> <script src=""></script> <link rel="stylesheet" href=""> <style> .blur { background-color: skyblue; } </style> </head> <body ng-app="app"> <div ng-controller="LearnKode"> <div class="container"> <p>Name: <input class="form-control" ng-model="blur" type="text" ng-class="{blur:isBlur}" ng-focus="isBlur=false;blur='Ng-Blur False'" ng-blur="count1=count1+1;ngBlur();isBlur=true" /></p> <p>Age <input class="form-control" type="text" /></p> <p>Total count {{count1}}</p> </div> </div> <script> var app = angular.module("app", []); app.controller('LearnKode', ['$scope', function ($scope) { $scope.ngBlur = function () { $scope.isBlur = true; $scope.blur = "Ng-Blur True"; } }]); </script> </body> </html>