7. What are custom filters? Write down a syntax of the same?

With AngularJS we can create our own filters. This can be done by associating the filter to our module. These types of filters are called custom filters.

Below is the code to count the number of elements in the string by using filter:

angular.module(‘myCountFilterApp’, [])
var out=[];
return out.length;
In the above example, if the string is “21, 34, 45” then output after applying filter will be 3.