Skip to main content
Question Protected by Pankaj Parkar
edited title
Link
Rahil Wazir
  • 10.1k
  • 11
  • 46
  • 66

Angular.js ng-repeat :filter by single field

added 2 characters in body
Source Link
bmleite
  • 26.9k
  • 4
  • 74
  • 46

I have an array of products that I'm repeating over using ng-repeat and am using

<div ng-repeat="product in products | filter:by_colour>by_colour"> 

to filerfilter these products by colour. The filter is working but if the product name / description etc contains the colour then the product remains after the filter is applied.

How do I set the filter to only apply to the colour field of my array rather than every field?

I have an array of products that I'm repeating over using ng-repeat and am using

<div ng-repeat="product in products | filter:by_colour> 

to filer these products by colour. The filter is working but if the product name / description etc contains the colour then the product remains after the filter is applied.

How do I set the filter to only apply to the colour field of my array rather than every field?

I have an array of products that I'm repeating over using ng-repeat and am using

<div ng-repeat="product in products | filter:by_colour"> 

to filter these products by colour. The filter is working but if the product name / description etc contains the colour then the product remains after the filter is applied.

How do I set the filter to only apply to the colour field of my array rather than every field?

added 4 characters in body
Source Link
Mark Rajcok
  • 365k
  • 114
  • 501
  • 494
Loading
Source Link
Tim Webster
  • 9.2k
  • 8
  • 30
  • 30
Loading