ng-repeat :filter by single field

后端 未结 12 2432
栀梦
栀梦 2020-11-22 10:06

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

<
12条回答
  •  生来不讨喜
    2020-11-22 11:05

    If you were to do the following:

  • {{preference.itemTitle}}
  • ...you would not only get items of itemTypeId 2 and itemStatus 1, but you would also get items with itemType 20, 22, 202, 123 and itemStatus 10, 11, 101, 123. This is because the filter: {...} syntax works like a string contains query.

    However, if you were to add the : true condition, it would do filter by exact match:

  • {{preference.itemTitle}}
提交回复
热议问题