AngularJS - remove duplicate records -


i new world of angularjs , working on angular 1.5

what trying remove duplicate records response before assigning $scope

the results looks following

[ {     "phonenumbers": [       {         "value": "00 1 111-222-333",         "pref": false,         "id": 0,         "type": null       },       {         "value": "00 1 222-222-333",         "pref": false,         "id": 1,         "type": null       },       {         "value": "00 1 333-222-333",         "pref": false,         "id": 2,         "type": null       }     ]   },{     "phonenumbers": [       {         "value": "00 1 111-222-333",         "pref": false,         "id": 0,         "type": null       },       {         "value": "00 1 222-222-333",         "pref": false,         "id": 1,         "type": null       },       {         "value": "00 1 333-222-333",         "pref": false,         "id": 2,         "type": null       }     ]   }] 

you notice there 2 arrays , both have sub array called phonenumbers , have exact same value.

what need if phonenumbers of array matches phonenumbers of array remove array response.

i appreciate on this.

enter image description here

this not angularjs question, rather general question of comparing objects , arrays. can find example in answer question https://stackoverflow.com/questions/7837456/how-to-compare-arrays-in-javascript


Comments

Popular posts from this blog

php - How to add and update images or image url in Volusion using Volusion API -

javascript - jQuery UI Splitter/Resizable for unlimited amount of columns -

javascript - IE9 error '$'is not defined -