Hi,

I have a response interceptor (very standard) which calls an injected 
(using $injector.get()) notification service when the response status code 
is 403 (to be exact, the detection occurs in the responseError).  On every 
API request, the server checks if the current logged in user has valid 
permissions/authorization to access a certain resource.  When it determines 
that it doesn't have access, it returns a "Access denied" message. 
 Currently I intentionally set the checks to always fail so that I can test 
for the Access Denied scenario.

The first time I enter the URL to my application, I have a BaseController 
which fires some AJAX request to the server to retrieve some user 
information as well as some navigation bar content.  I am also using 
ui-router for state management and the first state has a resolve property 
on it.  This resolve property fires a second AJAX request. Both will fail 
and hence will call my notification service when it hits the responseError 
part of my interceptor.

I only want to make one call to the service, instead of two.  I 
experimented with underscore's debounce, throttle, once, none seem to work 
as 2 notifications still show up instead of just one. How can this be done? 
 

-- 
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