-
Notifications
You must be signed in to change notification settings - Fork 77
DSHttpAdapter default $http config #111
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
Comments
👍 |
Think this line needs to be the other way like this: |
Yep |
Interceptors cannot be added by tweaking the config (see issue #139). So, given that the goal of this ticket was to be able to plug in interceptors, should this issue be re-opened? |
The fix for #139 was to remove the documentation that indicated that it was possible to add an interceptor to $http via Angular-data's API. The only way to add interceptors is via |
Sorry how are interceptors added then? I see this was added in 0.10.5 (changelog) / ffae052 But the more recent comment above says there is no angular-data API to do this. I can get an interceptor working with |
No, not if you're going to use the http adapter that comes with js-data-angular (that's not how Angular's DI works). However, you can load js-data-http which uses |
I think it would be good if you could provide some default config for $http in the DSHttpAdapter.
So you can add stuff like interceptors if you want to handle certain errors etc, for example that the user is not authenticated with the api.
I was thinking about these changes to the DSHttpAdapterProvider
Then one could add config to all $http requests that angular-data executes
The reason for not just configuring $http globally would be if you wanted to do other $http requests to other sources that is not your API
The text was updated successfully, but these errors were encountered: