Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- angular.module('watchApp').controller('userController', ['$scope', function ($scope) {
- $scope.users = users;
- $scope.h = checkBox;
- clearBoxes();
- clearUser();
- $scope.addUser = function (e) {
- if (e.confirmpassword === e.password)
- {
- $scope.users.push(e);
- clearUser();
- $scope.newUser = false;
- }
- else
- {
- alert("Password's don't match!")
- }
- }
- $scope.removeUser = function (h) {
- if ($scope.checkBox)
- {
- $scope.users.splice($scope.checkBox,1);
- clearBoxes();
- }
- }
- function clearUser() {
- $scope.e = {};
- $scope.e.users = $scope.users[0];
- $scope.newUser = false;
- }
- function clearBoxes() {
- $scope.checkBox = {};
- }
- }]);
Add Comment
Please, Sign In to add comment