SHARE
TWEET

Untitled

a guest Dec 2nd, 2014 149 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.                 var currentPopup = $scope.showPopup();
  2.                 ProductSearchService.submitsearch(data, canceller.promise, canceller).then(function(message) {
  3.                         currentPopup.close()
  4.                         // Anything to happen on success here
  5.                         $rootScope.SearchTerms = data.SearchField1;
  6.                         //LoaderService.hide();
  7.                         $scope.productreturndata = message.data.FoundRecords;
  8.                        
  9.                         if(message.data.result=="NoRecords") {
  10.                                 $rootScope.FoundRecords = false;
  11.                         }
  12.                         else {
  13.                                 $rootScope.FoundRecords = true;
  14.                         }
  15.                        
  16.                         tempsearchres = [];
  17.                         if (angular.isArray(message.data.FoundRecords.FoundRecordsItems)) {
  18.                                 tempsearchres = message.data.FoundRecords.FoundRecordsItems;
  19.                         }
  20.                         else {
  21.                                 tempsearchres[0] = message.data.FoundRecords.FoundRecordsItems;
  22.                         }
  23.                         $state.go('tabs.productresult');
  24.                 }, function(data,status){
  25.                         //LoaderService.hide()
  26.                         // Anything to happen on failure here
  27.                         showAlert("There was an error searching products. Error message: \n" + data.status);
  28.                 });
  29.  
  30. $scope.showPopup = function() {
  31.                 // An elaborate, custom popup
  32.                 var myPopup = $ionicPopup.show({
  33.                         title: 'Searching...',
  34.                         template: '<div class="spinner"></div>',
  35.                         scope: $scope,
  36.                         buttons: [
  37.                                 {
  38.                                         text: '<b>Cancel</b>',
  39.                                         type: 'button-positive',
  40.                                         onTap: function() {
  41.                                                 $scope.cancel();
  42.                                                 myPopup.close();
  43.                                         }
  44.                                 },
  45.                         ]
  46.                 });
  47.                 $timeout(function() {
  48.                         myPopup.close();
  49.                 }, canceller.promise);
  50.                 return myPopup;
  51.         };
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top