-
Notifications
You must be signed in to change notification settings - Fork 122
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
Allow Http service to be injected in JsonApiDatastore #4
Comments
I absolutely agree. My first attempt was exactly what you are suggesting. This was the
and you should have to configure your datastore like this:
The problem was this error: `Argument of type 'Http' is not assignable to parameter of type 'Http'. and, after many researches, the only way to solve was creating an injector for the Thanks! |
That is weird. I have exactly the same changes you wrote in my fork but for me everything works fine. Did you have different versions of angular between the app consuming this library and this library itself ? |
Ok, I discovered the problem. I'm developing this library using npm link and there is some strange bug with dependencies. If I npm install it or if I just copy it in node_modules folder, it works. |
Thanks @ghidoz 👍 |
I am using this angular2-jsonapi in the context of an Nativescript application. We use Nativescript-angular's NS_HTTP_PROVIDERS instead of HTTP_PROVIDERS. They basically extend the Http from Angular.
My issue is that the JsonApiDatastore completly ignores the provided Http from NS because it always creates an injector from the HTTP_PROVIDERS so none of my calls to our json-api work.
I think that, ideally, the http service should be injected directly in the JsonApiDatastore because it is the reponsiability of the consumer of this library to provide it.
The text was updated successfully, but these errors were encountered: