Page History
...
Code Block | ||||
---|---|---|---|---|
| ||||
$scope.mycallback = function(name,type) { return "something"; } |
Since Servoy 8.2 you must also define these functions in a special Api category of the spec, internalApi:. In prior versions define these in api section instead.
Code Block | ||||
---|---|---|---|---|
| ||||
"internalApi": { "mycallback " :{ "returns": "string", "parameters":[ { "name":"name", "type":"string" }, { "name":"type", "type":"string" } ] } } |
...
Code Block | ||||
---|---|---|---|---|
| ||||
// assign to the scope the svy-servoyapi scope: { model: '=svyModel', servoyApi: '=svyServoyapi' }, // in the controller or link functions you can use that then $scope.servoyApi.callServerSideApi("mycallback",["test",1]).then(function(retValue) { console.log(retValue); }); |
...
the callServerSideApi wants to have the function name and an array of arguments, it returns a promise of angular where the then function will give you the return value of the callback.
...
Overview
Content Tools
Activity