{"action":"opened","issue":{"url":"https://api.github.com/repos/djett41/ionic-filter-bar/issues/75","repository_url":"https://api.github.com/repos/djett41/ionic-filter-bar","labels_url":"https://api.github.com/repos/djett41/ionic-filter-bar/issues/75/labels{/name}","comments_url":"https://api.github.com/repos/djett41/ionic-filter-bar/issues/75/comments","events_url":"https://api.github.com/repos/djett41/ionic-filter-bar/issues/75/events","html_url":"https://github.com/djett41/ionic-filter-bar/issues/75","id":138269966,"number":75,"title":"How to get \"items: \" from this code?","user":{"login":"krxckz","id":17622728,"avatar_url":"https://avatars.githubusercontent.com/u/17622728?v=3","gravatar_id":"","url":"https://api.github.com/users/krxckz","html_url":"https://github.com/krxckz","followers_url":"https://api.github.com/users/krxckz/followers","following_url":"https://api.github.com/users/krxckz/following{/other_user}","gists_url":"https://api.github.com/users/krxckz/gists{/gist_id}","starred_url":"https://api.github.com/users/krxckz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/krxckz/subscriptions","organizations_url":"https://api.github.com/users/krxckz/orgs","repos_url":"https://api.github.com/users/krxckz/repos","events_url":"https://api.github.com/users/krxckz/events{/privacy}","received_events_url":"https://api.github.com/users/krxckz/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-03-03T19:10:46Z","updated_at":"2016-03-03T19:10:46Z","closed_at":null,"body":".controller('AdminreservationdataCtrl', function($stateParams, $scope, $state, Carservice, Locationservice, $ionicLoading, $ionicPopup, $ionicFilterBar) {\r\n\r\n  $ionicLoading.show({\r\n    template: 'Loading...'\r\n  });\r\n\r\n  $scope.bookings = []\r\n\r\n  var Booking = Parse.Object.extend(\"Booking\");\r\n  var bookingQuery = new Parse.Query(Booking);\r\n  bookingQuery.equalTo(\"isCompleted\", false)\r\n  bookingQuery.equalTo(\"isDecline\", false)\r\n  bookingQuery.find({\r\n    success: function(results) {\r\n      console.log(results.length)\r\n      if(results.length >0) {\r\n        angular.forEach(results, function(booking){\r\n\r\n          $scope.bookings.push(booking)\r\n          booking.bookingInfo = booking;\r\n\r\n          if(booking.bookingInfo.attributes.isCredit){\r\n            booking.payedInfo = \"Complete\"\r\n          } else {\r\n            booking.payedInfo = \"Unsuccessful\"\r\n          }\r\n\r\n          ///////////////Fetch User Detail/////////////////\r\n          var user = Parse.User.extend(\"user\");\r\n          var userQuery = new Parse.Query(user);\r\n          //console.log(booking.attributes.username.id);\r\n          var holdUsername = booking.attributes.username.id;\r\n          //console.log(hold)\r\n          userQuery.equalTo(\"objectId\", holdUsername);\r\n          //console.log(hold2);\r\n          userQuery.find({\r\n            success: function(user) {\r\n              booking.userInfo = user[0];\r\n              //console.log(booking.userInfo.attributes.first_name)\r\n\r\n              ///////////////Fetch Car Detail/////////////////\r\n              var Car = Parse.Object.extend(\"Car\");\r\n              var query = new Parse.Query(Car);\r\n              var currentCar;\r\n              query.get(booking.attributes.car_select.id, {\r\n                success: function(car) {\r\n                  //console.log(car.attributes.car_name);\r\n                  //console.log(car.attributes.no_plate);\r\n                  //console.log(car.attributes.trans);\r\n                  booking.carInfo = car\r\n\r\n                  ///////////////Fetch Pick location Detail/////////////////\r\n                  var Location = Parse.Object.extend(\"Location\")\r\n                  var picklocQuery = new Parse.Query(Location);\r\n                  picklocQuery.get(booking.attributes.pickloc.id, {\r\n                    success: function(location) {\r\n                      booking.pickLoc = location;\r\n\r\n                      ///////////////Fetch Drop location Detail/////////////////\r\n                      var Location = Parse.Object.extend(\"Location\")\r\n                      var droplocQuery = new Parse.Query(Location);\r\n                      droplocQuery.get(booking.attributes.droploc.id, {\r\n                        success: function(location) {\r\n                          booking.dropLoc = location;\r\n                          $ionicLoading.hide();\r\n\r\n                          $scope.gotoMore = function(booking) {\r\n                            console.log(booking.id)\r\n                            $state.go('morereservation', {id:booking.id})\r\n                          }\r\n\r\n                          $scope.gotoHistory = function() {\r\n                            $state.go('adminreservationdataHIS')\r\n                          }\r\n                        },\r\n                        error: function(location,error) {\r\n                          console.log(\"Error : \"+error);\r\n                        }\r\n                      })\r\n                      /////////////////////////////////////////////////////////\r\n                    },\r\n                    error: function(location,error) {\r\n                      console.log(\"Error : \"+error);\r\n                    }\r\n                  })\r\n                  /////////////////////////////////////////////\r\n\r\n                },\r\n                error: function(car, error){\r\n                  console.log(\"Error : \"+error);\r\n                }\r\n              })\r\n              ///////////////////////////////////////////////\r\n\r\n            },\r\n            error: function(user, error) {\r\n              console.log(\"Error : \"+error)\r\n            }\r\n          });\r\n          ///////////////////////////////////////////////\r\n        })\r\n      }\r\n      else {\r\n        $ionicLoading.hide();\r\n        $ionicPopup.alert({\r\n             title: 'Sorry',\r\n             template: 'You Dont Have Any Reservation At The Moment!'\r\n        });\r\n        $scope.gotoHistory = function() {\r\n          $state.go('adminreservationdataHIS')\r\n        }\r\n      }\r\n    },\r\n    error: function(error) {\r\n      console.log(\"Error : \"+error);\r\n    }\r\n  })\r\n\r\n  \r\n\r\n  $scope.showFilterBar = function () {\r\n      filterBarInstance = $ionicFilterBar.show({\r\n        items: $scope.bookings,\r\n        update: function (filteredItems, filterText) {\r\n          $scope.bookings = filteredItems;\r\n          if (filterText) {\r\n            console.log(filterText);\r\n          }\r\n        }\r\n      });\r\n    };\r\n\r\n})\r\n\r\n"}}