AngularJS lowercase and uppercase filter

Using lowercase and uppercase filter

Example: Use of lowercase and uppercase filter

<!DOCTYPE html>
<html>
     <head>
          <script src="Scripts/angular.min.js"></script>
     </head>
     <body style="font-family:Arial; font-size:medium; color:darkblue">
          <div ng-app="myModule" ng-controller="employeeCtrl">
               <h2>Use of lowercase and uppercase filter</h2>
               <table border="0">
               <tr>
                    <td>Enter first name:</td>
                    <td><input type="text" ng-model = "Employee.firstName"></td>
               </tr>
               <tr>
                    <td>Enter last name: </td>
                    <td><input type="text" ng-model= "Employee.lastName"></td>
               </tr>
               </table>
               <br/>
               <table border="0">
                    <tr>
                         <td>Name in Upper Case: </td>
                         <td>{{Employee.fullName()|uppercase}}</td>
                    </tr>
                    <tr>
                         <td>Name in Lower Case: </td>
                         <td>{{Employee.fullName()|lowercase}}</td>
                    </tr>
               </table>
          </div>
          <script>
               var myApp = angular.module("myModule", []);
               myApp.controller('employeeCtrl', function ($scope)
               {
                    $scope.Employee =
                    {
                         firstName: "Raj",
                         lastName: "Parihar",
                         fullName: function ()
                         {
                              var empObject;
                              empObject = $scope.Employee;
                              return empObject.firstName + " " + empObject.lastName;
                         }
                    };
               });
          </script>
     </body>
</html>


In this example we have used uppercase and lowercase filter to an expression using pipe character.

Output:
upper lowercase filters