Wednesday, July 1, 2015

AngularJS uppercase Filter

AngularJS filters are used to format/transform the data displayed in the view, filters can be used with expressions, ng-bind, ng-repeat etc and act upon the data from the model. The case filters are used to format cast strings between Upper/Lower cases.

The following is the syntax for using uppercase filters
{{<string/variable> | uppercase}}

The following is an example of using uppercase filter.

<html ng-app>
<head>
    <meta charset="utf-8" />
    <title>AngularJS - Basic</title>
    <script src="angular.min.js"></script>
</head>
<body>
          <div ng-init="name='Peter'">
                   <p>Output :<b> {{ name | uppercase }} </b></p>
          </div>
</body>
</html>

Output:


Similarly the lowercase filter will convert the String into a lower case string.

Search Flipkart Products:
Flipkart.com

No comments: