diff --git a/app/partials/customers/customers.controller.js b/app/partials/customers/customers.controller.js index 433037a..eb61fbc 100644 --- a/app/partials/customers/customers.controller.js +++ b/app/partials/customers/customers.controller.js @@ -135,6 +135,10 @@ $scope.removeValidation = function(){ $scope.showCompanyError = false; $('.companyNameInput').removeClass('customErrorInput'); + if($scope.data.companyName == 'undefined' || $scope.data.companyName == '') { + $('.companyNameInput').addClass('customErrorInput'); + $scope.showCompanyError = true; + } } $scope.removeMarginValidation = function(){ @@ -270,10 +274,9 @@ $scope.showLoader = false; }) } - - $scope.getCompanyName = function(parm){ - $scope.showLoader = true; - CustomersService.getCompanyName(parm).then(function(result) { + getCompanyName(); + function getCompanyName(){ + CustomersService.getCompanyName().then(function(result) { $scope.compNameList = result; }) } diff --git a/app/partials/customers/customers.html b/app/partials/customers/customers.html index 5b33eee..95ab363 100644 --- a/app/partials/customers/customers.html +++ b/app/partials/customers/customers.html @@ -179,7 +179,8 @@
- + +
diff --git a/app/partials/customers/customers.service.js b/app/partials/customers/customers.service.js index ef77ad3..506d3a7 100644 --- a/app/partials/customers/customers.service.js +++ b/app/partials/customers/customers.service.js @@ -164,11 +164,11 @@ return deferred.promise; } - this.getCompanyName = function(parm) { + this.getCompanyName = function() { var deferred = $q.defer(); $http({ method : 'GET', - url : BASE_URL.url +'/company/searchName?query='+parm, + url : BASE_URL.url +'/company/searchName', headers : {'Content-Type': 'application/json'}, }) .then(function (result){