Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ngx-restangular not triggering ngx-loadingbar loading bar #144

Closed
dericatienza opened this issue Jul 10, 2018 · 2 comments
Closed

ngx-restangular not triggering ngx-loadingbar loading bar #144

dericatienza opened this issue Jul 10, 2018 · 2 comments

Comments

@dericatienza
Copy link

I'm trying to get ngx-restangular to work with ngx-loadingbar. Bare requests made through HttpClient and route changes trigger the loading bar but requests made through Restangular just won't seem to trigger the loading bar. customPUTs and customPOSTs also trigger the loading bar.

@logan-jobzmall
Copy link

@dericatienza You need to add it to the RestangularConfigFactory method:

RestangularProvider.addFullRequestInterceptor(() => loader.start());
  RestangularProvider.addErrorInterceptor(() => loader.complete());
  RestangularProvider.addResponseInterceptor((data: any) => {
    loader.complete();
    return data || {};
  });

@rshchpkn
Copy link
Collaborator

@dericatienza Restangular isn't using HttpClient so ngx-loadingbar interceptor won't work. You could try @logan-jobzmall solution

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants