| AngularJS Filters
As we knows in another language filter is used to format data same as this done in AngularJS. Filter can be added in AngularJS to format data. Below are the different AngularJS Filters:-
(1)currency:-From this we will format number to a currency format.
(2)date:-From this we will format a date to a specific format.
(3)filter:-From this we will select a subset of items from an array.
(4)json:-From this we will format and object to JSON string.
(5)limitTo:-From this we will limits an array/string into a specified number of elements and charcaters.
(6)lowercase:-From this we will format a string to lower case.
(7)number:-From this we will format a number to a string.
(8)orderBy:-From this we will do orders an array by an expression.
(9)upppercase:-From this we will format a string to upper case.
Below is the example for converting string to uppercase and lowercase
Adding Filters to Directives
We can also add Filters to directives like ng-repeat and to use that we will use "|" pipe character to apply filter.
Currency Filter
The filter Filter
filter filter select a subset of an array. The filter filter can only be used on arrays and then returns array containing only the matching characters or items.
| | |