Beginner tutorial : How To Use Filter in angular

Filter is very awesome features of angular, in common language a filter is used to create subset of items from items or filter create little chunks from main result using some expression.

AngularJs provides two type filter

1 – Inbuilt filter : These filter in built with angular framework like uppercase, date, etc.
2- Custom filter : It’s a user defined filter which is created by developer based on custom requirement.

How to use Filter: Angular had very awesome documentation for filter on his official website, filter is very easy to use and under stable in AngularJS.

There are a lot of Cases where you need to use filter but here i am describing some cases which can be used in your application. I am taking below sample json data for understand filter in AngularJS.

Case 1: I need show only those user which name is Parvez. This is based on static filter value.

Case 2: I need show only those user which name is based on ‘search_name’ variable. This is based on dynamic filter value.

Case 3: I need show name in capital letter.


Case 4:
I need filter result set based on enter value into textbox.

Leave a Reply

Your email address will not be published. Required fields are marked *