0

I have 2 JSON objects and want to compare when a property of the first one appears in the second one.

Is there a way to do this using angular filters?

my html:

<div class="col-xs-6">
  <h1>prematch</h1>
  <ul ng-repeat="field in prematch | unique:'FIELD1'">
    <li> {{ field.FIELD1 }}</li>
    <li> {{ field.FIELD2 }}</li>
    <li><b>{{ field.url }}</b></li>
    <li>{{ field.FIELD7 }}</li>
  </ul>
</div>
<div class="col-xs-6">
  <h1>live</h1>
  <input ng-model="searchText">
  <ul ng-repeat="field in live | filter:searchText ">
    <li> {{ field.FIELD1 }}</li>
    <li> {{ field.FIELD2 }}</li>
    <li><b>{{ field.url }}</b></li>
    <li>{{ field.FIELD7 }}</li>
  </ul>
</div>

so...I want to filter the second ng-repeat with field.url in prematch (if field.url in prematch exists as field.url in live I want them displayed, otherwise not).

If you need further info about the controller or data structure let me know, but I think this is enough.

Miha Šušteršič
  • 9,742
  • 25
  • 92
  • 163
  • can u create a jsfiddle? – Shasha Aug 19 '15 at 10:23
  • u can go through this [link][1] i hope this will help ! [1]: http://stackoverflow.com/questions/30410121/comparing-objects-between-2-nested-arrays-in-angularjs-and-display-respective-ma – Shasha Aug 19 '15 at 10:45

0 Answers0