AngularJS provides different filters to format the data. The lowercase Filter formats the given string to the lowercase. In order to transmit & render the data from a TypeScript code to an HTML template (view), the interpolation concept can be utilized. The lowercase filter is piped with an expression that is declared inside the interpolation syntax.
Syntax:
{{expression|lowercase}}
Example 1: This example describes the AngularJS lowercase Filter by converting the entered string to lowercase.
HTML
<!DOCTYPE html>
< html >
< head >
< script src =
</ script >
</ head >
< body style = "text-align:center;" >
< h1 style = "color:green" >GeeksforGeeks</ h1 >
< h3 >AngularJS lowercase Filter</ h3 >
< div ng-app = "myApp" ng-controller = "myCtrl" >
< strong >Input:</ strong >
< br >
< input type = "text" ng-model = "string" >
< br >
< strong >Output:</ strong >
< br > {{string|lowercase}}
</ div >
< script >
var app = angular.module('myApp', []);
app.controller('myCtrl', function ($scope) {
$scope.string = "";
});
</ script >
</ body >
</ html >
|
Output:
Example 2: This example describes the AngularJS lowercase Filter by transforming the multiple lines of strings.
HTML
<!DOCTYPE html>
< html >
< head >
< script src =
</ script >
</ head >
< body style = "text-align:center;" >
< h1 style = "color:green" >GeeksforGeeks</ h1 >
< h3 >AngularJS lowercase Filter</ h3 >
< div ng-app = "myApp" ng-controller = "myCtrl" >
< strong >First Name:</ strong >
< br >
< input type = "text" ng-model = "firstName" >
< br >
< strong >Last Name:</ strong >
< br >
< input type = "text" ng-model = "lastName" >
< br >
< strong >Output:</ strong >
< br > {{firstName|lowercase}}
{{lastName|lowercase}}
</ div >
< script >
var app = angular.module('myApp', []);
app.controller('myCtrl', function ($scope) {
$scope.firstName = "";
$scope.lastName = "";
});
</ script >
</ body >
</ html >
|
Output:
Whether you're preparing for your first job interview or aiming to upskill in this ever-evolving tech landscape,
GeeksforGeeks Courses are your key to success. We provide top-quality content at affordable prices, all geared towards accelerating your growth in a time-bound manner. Join the millions we've already empowered, and we're here to do the same for you. Don't miss out -
check it out now!
Last Updated :
05 Sep, 2022
Like Article
Save Article