Response message in Angular-app

We’r building an Angular-app using RemObjects-SDK with the javascript-services.

The total responded datastream does have an array, result-flag and message.

{“version”:“1.1”
,“result”:
{“TypeRelationOut”:[
{“Company”:313,“Description”:“Profit”,“TypeRelation”:“PROF”}
,{“Company”:313,“Description”:“NonProfit”,“TypeRelation”:“NONP”}
,{“Company”:313,“Description”:“Particular”,“TypeRelation”:“PART”}]
,“Rslt”:true
,“Mess”:“3 records retrieved”
}}

The array “TypeRelationOut” is returned via a call like :
Service.SvcTypeRelation(“R”, myTypeRelation, function(result)
{ defer.resolve(result.toObject());});

But how to access “Rslt” and “Mess” in Angular/javasript ?

The generated Angular/json script is :

__namespace.JSONService.prototype.SvcTypeRelation = function(
Actie,
TypeRelationIn,
__success, __error) {
try {
var msg = this.fMessage.clone();
msg.initialize(this.fServiceName, “SvcTypeRelation”);
msg.write(“Actie”, “AnsiString”, Actie);
msg.write(“TypeRelationIn”, “TTypeRelation”, TypeRelationIn);
msg.finalize();
this.fChannel.dispatch(msg, function (__message) {
var __TypeRelationOut = __message.read(“TypeRelationOut”, “TTypeRelationArray”);
var __Rslt = __message.read(“Rslt”, “Boolean”);
var __Mess = __message.read(“Mess”, “AnsiString”);
__success(
__TypeRelationOut,
__Rslt,
__Mess
);
}, __error);

} catch (e) {
    __error(msg, e);
};

};

So how to achieve “__Rslt” and “__Mess” from this function?

Hello

Please take a closer look at the auto-generated method:

As you can see it accepts parameters that should be sent to the server and 2 callback functions. The success function is called later on as

So in this function you can access the values sent from the server.

Regards