SHARE
TWEET
Untitled
a guest
Dec 2nd, 2014
149
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
- var currentPopup = $scope.showPopup();
- ProductSearchService.submitsearch(data, canceller.promise, canceller).then(function(message) {
- currentPopup.close()
- // Anything to happen on success here
- $rootScope.SearchTerms = data.SearchField1;
- //LoaderService.hide();
- $scope.productreturndata = message.data.FoundRecords;
- if(message.data.result=="NoRecords") {
- $rootScope.FoundRecords = false;
- }
- else {
- $rootScope.FoundRecords = true;
- }
- tempsearchres = [];
- if (angular.isArray(message.data.FoundRecords.FoundRecordsItems)) {
- tempsearchres = message.data.FoundRecords.FoundRecordsItems;
- }
- else {
- tempsearchres[0] = message.data.FoundRecords.FoundRecordsItems;
- }
- $state.go('tabs.productresult');
- }, function(data,status){
- //LoaderService.hide()
- // Anything to happen on failure here
- showAlert("There was an error searching products. Error message: \n" + data.status);
- });
- $scope.showPopup = function() {
- // An elaborate, custom popup
- var myPopup = $ionicPopup.show({
- title: 'Searching...',
- template: '<div class="spinner"></div>',
- scope: $scope,
- buttons: [
- {
- text: '<b>Cancel</b>',
- type: 'button-positive',
- onTap: function() {
- $scope.cancel();
- myPopup.close();
- }
- },
- ]
- });
- $timeout(function() {
- myPopup.close();
- }, canceller.promise);
- return myPopup;
- };
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.

