1 2angular.isUndefinedOrNull = function (val) { 3 return angular.isUndefined(val) || val === null 4} 5 6var app = angular.module("CustomApp", ['CustomApp.Resource']); 7 8app.directive('ngEnter', function () { 9 return function (scope, element, attrs) { 10 element.bind("keydown keypress", function (event) { 11 if (event.which === 13) { 12 scope.$apply(function () { 13 scope.$eval(attrs.ngEnter); 14 }); 15 16 event.preventDefault(); 17 } 18 }); 19 }; 20}); 21 22 23app.controller("PopupDotMailer", function ($scope, FrontResource) { 24 25 26 27 28 29}); 30 31app.controller("BallotSignUp", function ($scope, FrontResource) { 32 33 $scope.Init = function () { 34 35 $scope.GetBallotObj(); 36 } 37 38 $scope.GetBallotObj = function () { 39 40 FrontResource.GetBallotObj().then(function (response) { 41 42 $scope.BallotObj = response.data; 43 }); 44 45 } 46 $scope.SaveDetails = function (SignUpFormObj) { 47 48 if ($scope.validateForm(SignUpFormObj)) { 49 $scope.IsExist = false; 50 $scope.IsSucess = false; 51 FrontResource.PostBallotSignUpFormObj(SignUpFormObj).then(function (response) 52 { 53 if (response.data == "NO") 54 { 55 location.href = "/ballot-register" 56 //$scope.IsExist = true; 57 } 58 else 59 { 60 $scope.IsSucess = true; 61 $scope.Init(); 62 } 63 }); 64 65 }; 66 } 67 $scope.validateForm = function (SignUpFormObj) { 68 var isValid = true; 69 if (isValid && angular.isUndefinedOrNull(SignUpFormObj.firstName)) { 70 alert('Please fill your first name.'); 71 $('#firstName').focus(); 72 isValid = false; 73 } 74 if (isValid && angular.isUndefinedOrNull(SignUpFormObj.lastName)) { 75 alert('Please fill your last name.'); 76 $('#lastName').focus(); 77 isValid = false; 78 } 79 if (isValid && angular.isUndefinedOrNull(SignUpFormObj.email)) { 80 alert('Please enter correct email.'); 81 $('#email').focus(); 82 isValid = false; 83 } 84 85 return isValid; 86 } 87 88 89}); 90
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.