Hello,
I have a form in my app which sends two dates to my php-script. This script collects the requests that are between the given dates. Now, I have an array with the requests in json-objects. Works perfect.
What I would like to do is sending these requests to a service to be able to have a master and detail page of these requests.
So, I have the date in my controller. But I would like it to have in a service.
The data is in $scope.foundRequests:
$http.post("http://url/to/searchreports.php", data,{"startdate": $scope.searchData.startdate, "enddate": $scope.searchData.enddate})
.success(function(data){
if (!data) {
$scope.loadingIndicator = $ionicLoading.show({
content: 'Loading Data',
animation: 'fade-in',
showBackdrop: false,
maxWidth: 200,
showDelay: 100
});
$timeout(function() {
console.log("something is wrong");
$ionicLoading.hide();
}, 1000);
} else {
$scope.foundRequests = data;
console.log($scope.foundRequests);
$scope.loadingIndicator = $ionicLoading.show({
content: 'Loading Data',
animation: 'fade-in',
showBackdrop: false,
maxWidth: 200,
showDelay: 100
});
$timeout(function() {
$ionicLoading.hide();
$scope.searchData.startdate = "";
$scope.searchData.enddate = "";
}, 1000);
}
})