# Category: callback

## AngularJS restangular post callback

I am using restangular with AngularJS, and I need to use some function, which will trigger callback function/promise after POST response. I tryed setResponseInterceptor which did not helped in this situation. I need to use this function to lock form from submission until response will come back to client, and then unlock it to future use. Do you know some magic for this? I am using this code, and want to fire custom function when […]

## scope variable can not be setted inside service callback

I have the following code: svcUploadMidia.load(scope.TableId, scope.TableName, function(res) { scope.Midias = res.data; for(var i = 0; i < scope.Midias.length; i++) { scope.Midias[i].conteudoBase64 = “data:image/png;base64,” + scope.Midias[i].conteudoBase64; } }, function(err) { errorHandler(err); }); This code is inside a directive and is called by another directive. But all changes made inside the svcUploadMidia.load callback is not setted in the directive scope.Midias and the ng-repeat in the html still empty. Someone know how can I fix it? Source: AngularJS