Guest User

Untitled

a guest
Mar 20th, 2016
32
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  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. }]);
Add Comment
Please, Sign In to add comment