ng-repeat Filter By Single Field In AngularJS




Normally ng-repeat is used for implementing Loops in AngularJS. Here we explain, how to use ng-repeat filter by Single Field. Lets consider the example shown below. Here we are trying to filter the list of prodcuts with their color.

ng repeat Filter By Single Field In AngularJS, How To use ng repeat Filter By Single Field In AngularJS, Filter ng-repeat data By Single Field In AngularJS, ng repeat Filter By Any Object In AngularJS, Filtering the ng-repeat By field, HTML, PHP, Asp.Net

ng repeat Filter By Single Field In AngularJS, How To use ng repeat Filter By Single Field In AngularJS, Filter ng-repeat data By Single Field In AngularJS, ng repeat Filter By Any Object In AngularJS, Filtering the ng-repeat By field, HTML, PHP, Asp.Net

For filtering the products by Single Field we have two cases.

1. filter the products with exact blue color. The format is as follows.

ng-repeat="product in products | filter: { color: 'blue' }: true"


2. filter the products that contains blue color like lightblue.
The format is as follows.


ng-repeat="product in products | filter: { color: 'blue' }"


By this way we can use ng-repeat filter by Single Field.