Open In App

AngularJs uppercase Filter

Last Updated : 05 Sep, 2022
Suggest changes
Share
Like Article
Like
Report

The uppercase Filter in AngularJS is used to change a string to an uppercase string or letters

Syntax:

{{ string | uppercase}}

Example: This example describes the use of the uppercase Filter in AngularJS.

HTML
<!DOCTYPE html> <html> <head> <title>uppercase Filter</title> <script src= "https://ajax.googleapis.com/ajax/libs/angularjs/1.5.6/angular.min.js">  </script> </head> <body ng-app="app" style="text-align:Center"> <h1 style="color:green"> GeeksforGeeks </h1> <h2>AngularJS uppercase Filter</h2> <div ng-controller="geek"> <p> <span style="color:green"> {{msg | uppercase}} </span> is the computer science portal for geeks. <p> </div> <script>  angular.module('app', [])  .controller('geek',  ['$scope', function ($scope) {  $scope.msg = 'GeeksforGeeks';  }]);  </script> </body> </html> 

Output:

 

Example 2: This example describes the use of the uppercase Filter in AngularJS by transforming the entered text to uppercase.

HTML
<!DOCTYPE html> <html> <head> <script src= "https://ajax.googleapis.com/ajax/libs/angularjs/1.6.9/angular.min.js">  </script> <style>  body {  text-align: center;  font-family: arial;  }  h1 {  color: green;  }  </style> </head> <body> <h1>GeeksforGeeks</h1> <h2>AngularJS uppercase Filter</h2> <div ng-app="myApp" ng-controller="myCtrl"> <strong>Input:</strong> <br> <input type="text" ng-model="string"> <br> <strong>Output:</strong> <br> {{string|uppercase}} </div> <script>  var app = angular.module('myApp', []);  app.controller('myCtrl', function ($scope) {  $scope.string = "";  });  </script> </body> </html> 

Output:

 

Next Article

Similar Reads