Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- angular.module('watchApp').controller('userController', ['$scope', function ($scope) {
- $scope.users = users;
- 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) {
- for (var i = 0; i < $scope.users.length; i++)
- {
- if($scope.checkBox == true)
- {
- $scope.users.splice(i, 1);
- clearBoxes();
- }
- }
- }
- function clearUser() {
- $scope.e = {};
- $scope.e.users = $scope.users[0];
- $scope.newUser = false;
- }
- function clearBoxes() {
- $scope.checkBox = {};
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement