Search Posts

Category: request

Angular $resources Cancel requests : $q

how to Angular $resources Cancel requests : $q I’m trying to understand… How can I implement a requests cancell for this kind of services. I was reading, that I shoud use $q.defer() angular.module(‘App’).service(‘TService’, function ($resource, portal) { return $resource(portal.getUrlServer() + ‘api/T/:id’, { id: ‘@Id’ }, { T_GET: { method: ‘GET’, params:{ id_turno: ‘@id_turno’, }, url: portal.getUrlServer() + ‘api/T/T_GET/’ }, G_GET_Turno: { method: ‘GET’, params: { id_tramite_relevado : ‘@Id_Tramite_Relevado’ }, url: portal.getUrlServer() + ‘api/T/G_GET_Turno/’ }, }); […]

Attaching attribute to RequestContext – pass element from frontend to backend

I have written frontend in angularjs and backend in spring-boot. I need to pass some attribute from backend to frontend. This attribute is some configuration set from frontend should be passed with each request to backend. When it comes to authorization we are using LDAP. The whole aim is to be able to do: String myConf = RequestContextHolder.getRequestAttributes().getAttribute( “myConf”, RequestAttributes.SCOPE_REQUEST); I have no idea how to do it. Can you help me, please? Source: AngularJS