Ng-Keydown-6

 

When we type in textbox ng-keydown directive will call the lowerCase(text) function which convert the uppercase character to lowercase.

 
 
 
<!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Welcome to LearnKode - A code learning platform</title> <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.2/angular.min.js"></script> </head> <body ng-app="clickExample"> <div ng-controller="ExampleController"> Upper Case: <input type="text" ng-model="text" ng-keydown="lowerCase(text)" /><br /> </div> <script> var app = angular.module("clickExample", []); app.controller('ExampleController', ['$scope', function ($scope) { $scope.lowerCase = function (txt) { $scope.text = txt.toLocaleLowerCase(); } }]); </script> </body> </html>
Output