Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $scope.SearchProvider = function(searchParam){
- try{
- $scope.searchMode = 1;
- var queryString='';
- if($scope.formModel && $scope.formModel !== searchParam){
- $scope.resultsCount = 0;
- currentPage = 1;
- }
- if(searchParam){
- $scope.formModel = searchParam;
- for(var param in searchParam){
- if(searchParam.hasOwnProperty(param)){
- var paramValue = searchParam[param].value ? searchParam[param].value.trim() : searchParam[param].trim();
- if (paramValue.length > 0)
- queryString += param + '=' + paramValue + '&';
- }
- }
- }
- //debugger;
- console.log(queryString);
- queryString= '?' + queryString + 'currentpage=' + $scope.currentPage;
- $http.get("/includes/ReturnProvidersList.cfm" + queryString)
- .then(function(response){
- $scope.providers = response.data.provider;
- $scope.resultsCount = response.data.rowCount;
- if (!$scope.providers){
- $scope.NoResults = true;
- $scope.ShowResults = false;
- $scope.ShowDesc = false;
- $location.hash('error');
- // call $anchorScroll()
- $anchorScroll('error');
- }
- else if($scope.providers){
- $scope.NoResults = false;
- $scope.ShowResults = true;
- $scope.ShowDesc = false;
- $location.hash('ResultsAnchor');
- // call $anchorScroll()
- $anchorScroll('ResultsAnchor');
- }
- else{
- $scope.NoResults = false;
- $scope.ShowResults = false;
- $scope.ShowDesc = true;
- $location.hash('noScroll');
- // call $anchorScroll()
- $anchorScroll('noScroll');
- }
- })
- }
- catch(err){ alert('No response.: ' + err.message); }
- }
Add Comment
Please, Sign In to add comment