Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Thread Contributor: Ravishankar ChavarePart 7 - Basic of Filters in AngularJS
AngurJS Filter:
[Image: tIvseWl.png]
-Filters in angularjs takes input and produces some modified output.
-The output of filter will be a formatted output or input.
-Selects a subset of items from array and returns it as a new array.
-Filters can be added in AngularJS to format data.

Filters can be used for commonly following task
1.Format data.
2.transform data. or filter data.

Filters can be used in
-views(HTML data)

There are two types of filters

1.Built-in filters.
number,date uppercase,filter,lowercase orderBy etc.

2.Custom filters.
Developed by us

Filters can be added to expressions by using the pipe character |, followed by a filter name.

Example to use filter in html view
{{ filter_expression | filter : expression : comparator : anyPropertyKey}}

Example to use filter in javascript or in service

$filter('filter')(array, expression, comparator, anyPropertyKey)

Forum Jump:

Users browsing this thread: 1 Guest(s)