Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

193
Views
How can i push an array onto another if element doesnt exist AngularJS?

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 ?

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!