Hi All
We're developing a modularised application which has the following pattern:

Directives (with controllers) are created for easy "lift-and-shift" of 
modules between pages
The directives call factories which either
  - Returns $q.when(variable) if variable has been found in the localStorage
  - Calls a service (using $resource), validates the response then saves it 
in localStorage

The issue I'm struggling with is multiple directives are calling using the 
same factories, which when the localStorage is empty is causing multiple 
XHR requests firing to the same api (which can take 20 seconds on occasion 
due to them doing LOADS).

My question is, what's the best approach to "group" them so that if the 
first call's promise hasn't resolved, the second call returns the original 
promise instead.

Thanks in advance
Jim

-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to