Page 1 of 1

How to execute query service: using Apperyio.get

Posted: Sat Apr 18, 2015 7:37 am
by Dupdroid

How would I pass the where clause when executing a service in my bootstrap app. Is there any documentation on "Apperyio.get" and how to execute services using it?

code
Apperyio.get("My_query_service")({data:{"where":{"artist._id":id}}}).then(
function(success){
var list_scope = $scope["list"];
list_scope = success.data;
$scope["list"] = list_scope;
},
function(error){

}
);
/code


How to execute query service: using Apperyio.get

Posted: Sat Apr 18, 2015 10:35 am
by Serhii Kulibaba

Hello,

Please look tutorial below: https://devcenter.appery.io/tutorials...


How to execute query service: using Apperyio.get

Posted: Sun Apr 19, 2015 11:49 am
by Dupdroid

Thank you but that does not help.

I asked if there is any documentation on "Apperyio.get" or an example of how to execute a Query service and passing the where clause using the "Apperyio.get" method.

As far as I know that tutorial does not include such an example.


How to execute query service: using Apperyio.get

Posted: Sun Apr 19, 2015 12:53 pm
by Dupdroid

Figured it out, see below

code
var requestData = {};
requestData.params = Apperyio.EntityAPI('My_query_service.request.query', undefined, true);

var id_scope = $scope["id"];
requestData.params["where"] = {"artist._id":id_scope};

Apperyio.get("My_query_service")(requestData).then(

Code: Select all

 function(success){ 

var list_scope = $scope["list"];
list_scope = success.data;
$scope["list"] = list_scope;

Code: Select all

 }, 
 function(error){ 

 }); 

/code


How to execute query service: using Apperyio.get

Posted: Sun Apr 19, 2015 12:56 pm
by Evgene Karachevtsev

Hello Dupdroid,

Thank you for the update.