Guest User

Untitled

a guest
Dec 19th, 2018
261
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.17 KB | None | 0 0
  1. if ($scope.MultiEmailsList.contains($scope.SingleEmail))
  2. {
  3. console.log("Mail Id Already Exists");
  4. }
  5. else
  6. {
  7. console.log("Mail Id Not Exists");
  8. }
  9.  
  10. function existsInArray( arr, item ) {
  11.  
  12. for( var i = 0; i < arr.length; i++ )
  13. if( arr[ i ] === item ) return true;
  14.  
  15. return false;
  16.  
  17. }
  18.  
  19. if ($scope.Email.indexOf($scope.user.Email) !== -1)
  20. {
  21. console.log("Mail Id Already Exists");
  22. }
  23. else
  24. {
  25. $http({
  26. method: 'POST',
  27. url: 'index.php/Welcome/Signup',
  28. data: $scope.user,
  29. headers: {'Content-Type': 'application/x-www-form-urlencode'}
  30. }).success(function (data) {
  31. $scope.Enquiry = data;
  32. console.log(data);
  33. $location.path('/EnquiryResponse');
  34. });
  35. }
  36.  
  37. $scope.MultiEmailsList = ["nitin@gmail.com","test@gmail.com"];
  38. $scope.SingleEmail = "nitin@gmail.com";
  39.  
  40.  
  41. if(($scope.MultiEmailsList).indexOf($scope.SingleEmail)!= -1){
  42. console.log("value exists");
  43. }else{
  44. console.log("value not exists");
  45. }
Add Comment
Please, Sign In to add comment