I have 2 arrays
$scope.allnamesList =[];
$scope.namesList = result.data.namesfields;
The problem is that i cant clear the allnamesList because i want to preserve values on client side.
I have tried $scope.allnamesList.push.apply($scope.allnamesList, $scope.namesList), but the issue is that it keeps adding even if the values returned from MVC in the result.data.namesfields are already present in $scope.allnamesList.
Is it possible to do a push of elements in nameslist if they dont already exist in allnamesList ?