1.

What is the use of a filter in AngularJS?

Answer»

<P>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>



Discussion

No Comment Found