Ionic app

Cant understand what is wrong now? Any clue? A have the barscanner then a query

**BARSCAN**

Sent the text to variable ean_code then a invoke the service Search

var requestData = {};
/*CLICK TO EDIT MAPPING*/

// read more about using rest services: https://links.appery.io/ve-snippet-rest
Apperyio.get("Barcode_scan")(requestData).then(
function(success){ // success callback
(function mapping1806(success, $scope){
var Products_scope = $scope.Products;
_.set(Products_scope, 'ean_code', success.text);
$scope.Products = Products_scope;
/*CLICK TO EDIT MAPPING*/
var requestData = {};
/*CLICK TO EDIT MAPPING*/

// read more about using rest services: https://links.appery.io/ve-snippet-rest
Apperyio.get("Planet4us_products_query_service")(requestData).then(
function(success){ // success callback
/*CLICK TO EDIT MAPPING*/

},
function(error){ // callback to handle request error

},
function(notify){ // notify callback, can fire few times

});

})(success, $scope);

},
function(error){ // callback to handle request error

},
function(notify){ // notify callback, can fire few times

});

**SEARCH**

Query to database return values...then a want it to navigate to page...

var requestData = {};
requestData = (function mapping8806($scope){
var requestData = {};
requestData.params = {};
var Products_scope = $scope.Products;
requestData.params.where = new Function('$scope, value', 'return {"ean_code" : value};')($scope, Products_scope.ean_code);

return requestData;
/*CLICK TO EDIT MAPPING*/
})($scope);

// read more about using rest services: https://links.appery.io/ve-snippet-rest
Apperyio.get("Planet4us_products_query_service")(requestData).then(
function(success){ // success callback
(function mapping7815(success, $scope){
var Products_scope = $scope.Products;
_.set(Products_scope, 'ean_code', success.data[0].ean_code);
_.set(Products_scope, 'product_name', success.data[0].product_name);
_.set(Products_scope, 'image_token', success.data[0].Product_image);
$scope.Products = Products_scope;
/*CLICK TO EDIT MAPPING*/

Apperyio.navigateTo("Result", {});

})(success, $scope);

},
function(error){ // callback to handle request error

},
function(notify){ // notify callback, can fire few times

});
1 person has
this question
+1
Reply