Ng-Blur-6

 

In this example of Ng-Blur, Textarea height will increase or decreased based on focus and blur.  

 
 
 
<!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"> <style> .active { height: 200px !important; } </style> </head> <body ng-app="app"> <div class="container"> <div ng-controller="LearnKode"> <div class="row"> <br /> <label class="col-md-2">Description :</label> <div class="col-md-10"> <textarea ng-class="{true:'active',false:''}[increaseHeight]" class="form-control" ng-focus="increaseHeight=true" ng-blur="increaseHeight=false"></textarea> </div> </div> </div> </div> <script> var app = angular.module("app", []); app.controller('LearnKode', ['$scope', function ($scope) { }]); </script> </body> </html>
Output