SHARE
TWEET

Untitled

a guest Mar 20th, 2016 19 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. angular.module('watchApp').controller('userController', ['$scope', function ($scope) {
  2.     $scope.users = users;
  3.     $scope.h = checkBox;
  4.  
  5.     clearBoxes();
  6.     clearUser();
  7.  
  8.     $scope.addUser = function (e) {
  9.         if (e.confirmpassword === e.password)
  10.         {
  11.             $scope.users.push(e);
  12.             clearUser();
  13.             $scope.newUser = false;
  14.         }
  15.         else
  16.         {
  17.             alert("Password's don't match!")
  18.         }
  19.     }
  20.  
  21.     $scope.removeUser = function (h) {
  22.             if ($scope.checkBox)
  23.             {
  24.                 $scope.users.splice($scope.checkBox,1);
  25.                 clearBoxes();
  26.             }
  27.     }
  28.  
  29.     function clearUser() {
  30.         $scope.e = {};
  31.         $scope.e.users = $scope.users[0];
  32.         $scope.newUser = false;
  33.     }
  34.  
  35.     function clearBoxes() {
  36.         $scope.checkBox = {};
  37.     }
  38.  
  39.    
  40.    
  41. }]);
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top