Page 1 of 1

How to pass a parameter to the success callback function of a service?

Posted: Mon Jun 10, 2013 2:08 pm
by w

I would want to be able to pass a parameter to the myService.execute({}) method, that I can use in the success event. Is this possible?

That way I would have access to the 'data' response in the success event, plus my own parameter.

I cannot use a localStorage variable to pass a parameter, because the parameter is unique for each service call, and multiple service calls are being made one after the other. So if I use a localStorage variable, it is overwritten too fast by the subsequent asynchronous myService.execute calls.


How to pass a parameter to the success callback function of a service?

Posted: Mon Jun 10, 2013 2:15 pm
by w

So I want to override the default success callback function from the service.execute method and give it an extra parameter.(now it has default 1 parameter 'data' )


How to pass a parameter to the success callback function of a service?

Posted: Mon Jun 10, 2013 3:06 pm
by Maryna Brodina

Hello! The only one way is to create Generic service https://getsatisfaction.com/apperyio/...