I have those objects for example [object1,object2,object3] each object is a row from selected row in the ui-grid in angular.
of course I can update in each select so I can get 1 object per click or all the selected value in each event click. it does not really matter.
object1 contain 2 arrays , I Need the users array from each object object1->users array = 0 -name=dani , 1- name=John
object 2->users->0:name:dani, 1:name:Victor,2:name:vika
object3-> users->0:name:cris 1:name:Luke ,2:name:vika
also I have an public array(selectbox) that need to be updated according those objects
$scope.arr= Macel,kiko,dani,vika,Victor,John,cris,Luke
I need a new array that reduce the common users so the new array will be :Marcel, kiko
new array= [Macel,kiko]
and the new array will populated in the select box because Marcel and kiko are not appear in the users objects
what is the efficient way to do that in angular ,I already tried 3 nested foreach but it is not efficient way
thx very much