The uppercase filter is used to change a string to uppercase string or letters.
Syntax for uppercase filter in AngularJS:
Sample coding for uppercase filter in AngularJS:
uppercase Filter in AngularJS:
The msg string value will be displayed in uppercase format.
Collection of data has been defined in AngularJS Application.
Controller logic for the AngularJS Application.
Viewable HTML contents in AngularJS Application.
Code Explanation for uppercase filter in AngularJS:
The AngularJS application is defined by ng-app="myApp". The application runs inside the <div> tag. It’s also used to define a <div> tag as a root element.
The ng-controller=”ucaseCtrl” is an AngularJS directive. It is used to define a controller name as “ucaseCtrl”.
The uppercase filter is used to change an msg string to uppercase.
The angular.module function is used to create a Module.
Here we have declared a controller ucaseCtrl module using apps.controller() function. The value of the controller modules is stored in scope object. In AngularJS, $scope is passed as first argument to apps.controller during its constructor definition.
Here we have set the value of $scope. msg = “Welcome To AngularJS Tutorials” which are to be used to change a string to uppercase in HTML element.
Sample Output for uppercase filter in AngularJS:
The output shows that an uppercase filter is used to change a string “Welcome To AngularJS Tutorials” to uppercase letter “WELCOME TO ANGULARJS TUTORIALS”.
angular uppercase input$filter('uppercase')()angular custom filterconvert string to uppercase in angularjsangularjs filtersangular built in filtersangular multiple filtersangularjs title caseangular filter exampleangularjs filter ng-repeatangular filter dateangular filter in controllerangularjs custom filterangularjs tutorials
World's No 1 Animated self learning Website with Informative tutorials explaining the code and the choices behind it all.