Trending News
Home / Web Development / Angular Js / AngularJS Filters

AngularJS Filters

Filters can be added in AngularJS to format data. Filters are used to change modify the data. Following is the list of commonly used filters.

Sr.No. Name Description
1 uppercase converts a text to upper case text.
2 lowercase converts a text to lower case text.
3 currency formats text in a currency format.
4 filter filter the array to a subset of it based on provided criteria.
5 orderby orders the array based on provided criteria.




uppercase filter

Convert the string to upper case format. All the text or string convert or print as uppercase format or capital letter format.

Example




The output as : The name is PRITTY

lowercase filter

Convert the string to lower case format. All the text or string convert or print as lowercase format or small letter format.

Example




The output as : The name is pritty

currency filter

This filter formats a currency filter to a number. When no currency symbol is provided, default symbol for current locale is used.

{{ expression | currency : ‘currency_symbol’ : ‘fraction’}}

Example

The output as: Price: $158.00

filter filter

The filter filter selects a subset of an array.

{{ expression | filter : filter_criteria }}

Example




This example displays only the names containing the letter “i”.

The output as follows
Jani
Birgit
Kai

Orderby Filters

The orderBy filter sorts an array based on specified expression predicate.
{{ expression | orderBy : predicate_expression : reverse}}

Loading Facebook Comments ...
Social Media Auto Publish Powered By : XYZScripts.com