As mentioned in the previous post, we use ng-repeat directive to iterate through a set of values. There may be certain scenarios in which we might need to pre-process the data below updating or displaying it on the page. For example, we might need to convert all the cities which we need to display on the page to uppercase.

To use filters on directive and expression we use pipe character.

Example.

  • {{ city | uppercase }}

Below mentioned is the list of filters that we can use in AngularJS.

currency	Format a number to a currency format.
filter	Select a subset of items from an array.
lowercase	Format a string to lower case.
orderBy	Orders an array by an expression.
uppercase	Format a string to upper case.

Related Posts

Leave a Reply