- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to convert a string into uppercase in AngularJS?
Sometimes we may need to represent a name or a string in capital letters. To convert a string into uppercase in AngularJS, we can use the uppercase filter to change its case to uppercase.
Syntax
- In HTML Template Binding
{{uppercase_expression | uppercase}}
- In JavaScript
$filter('uppercase')()
Example − Conversion to Upper Case
Create a file "uppercase.html" in your Angular project directory and copy-paste the following code snippet.
<!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"> Welcome to Tutorials Point </h1> <h2 style="color: grey;"> AngularJS | UpperCase Filter </h2> <div ng-controller="example"> <p> <h2> Original: {{message}} </h2> <h2> Modified: {{message | uppercase}} </h2> <p> </div> <script> angular.module('app', []) .controller('example',['$scope', function($scope) { $scope.message = 'simply learning'; }]); </script> </body> </html>
Output
To run the above code, just go to your file and run it as a normal HTML file. You will see the following output on the browser window.
- Related Articles
- Convert a String to Uppercase in C
- How to convert string to uppercase in TypeScript?
- Swift Program to Convert a String to Uppercase
- How to convert lowercase letters in string to uppercase in Python?
- Convert string to lowercase or uppercase in Arduino
- How to convert all uppercase letters in string to lowercase in Python?
- Java program to convert a string to lowercase and uppercase.
- For the Hosts Locale how to convert a string to uppercase letters in JavaScript?
- How to convert the content of the file into uppercase or lowercase?
- How to convert a string into integer in JavaScript?
- How to convert a String into int in Java?
- How to convert a string into int in C#?
- How to convert a string into number in PHP?
- Write a C program to convert uppercase to lowercase letters without using string convert function
- How to convert a string into Title Case in Golang?

Advertisements