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.
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
Post a Comment