Loading…

What is the use of a filter in AngularJS?

It is used to format the value of the expression to display the output. AngularJS enables us to apply filter. It can be added to expressions by using the pipe character |, followed by a filter.

Example

                                        

<div ng-app="myApp" ng-controller="personCtrl">    

<p>The name is {{ firstName | uppercase }}</p>    

</div>    

<script>    

angular.module('myApp', []).controller('personCtrl', function($scope) {    

    $scope.firstName = "Umesh",    

    $scope.lastName = "Singh"    

});    

</script>   

Suggest An Answer

No suggestions avaliable!

Latest post from Angularjs Interview Questions

Ask Question