Questions tagged [injectableprovider]

9 questions
10
votes
1 answer

Jersey: InjectableProvider not picked up - Spring

I am currently trying to create an InjectableProvider with Jersey, but I cannot get Jersey to pick it up. I cannot find any real examples of its usage, or even how to get it picked up besides using the @Provider annotation on the implementation. The…
pickypg
  • 22,034
  • 5
  • 72
  • 84
4
votes
3 answers

How to inject a provider in Angular 2 service from action?

I am trying to remove the dependency of components on services in Angular with the help of Redux. Basically, the flow is Component -> Action -> Service In the service I want to use http module of @angular/core, which is suggested to be passed in the…
Sanjeev
  • 855
  • 1
  • 9
  • 15
2
votes
0 answers

Angular 4 - DI: How to inject IntersectionObserver in my Components

As I would like to use the fade-in on scroll feature you can see on many websites, I would like to know how to implement such functionality in my application the "angular way". I already have a component implementation that works and maybe this…
1
vote
2 answers

Angular abstract class HttpClient injection

Hi everyone, i'm new with Angular and I am having troubles with Injectable classes. I have an abstract class (on web.ts) which one of its protected attributes is an HttpClient object. The definition of this abstract class is as follows: import {…
Salva Corts
  • 862
  • 1
  • 7
  • 12
0
votes
0 answers

Angular 14 : I have service in a module and I want to use it in other module but VS code says that could not find it

Cannot find module '../../myservice;' or its corresponding type declarations. By having the service as Injectable with providedIn root , this should be available throughout the project right? @Injectable({ providedIn: 'root', }) I have them in both…
0
votes
0 answers

Angular reset service when log out

I am building an app with ngx socket io which connects properly and works fine. This app is securized and it connects to an URL including the username. As the URL is different for each user I have defined a custom socket with my config: import {…
Videgain
  • 155
  • 3
  • 15
0
votes
0 answers

Injectable providers Lifecycle on Angular with Lazy Loading

I have a doubt about when is destroyed a provider on Angular. This is my a part of my provider: ... @Injectable() export class ApiHelper { private myState = {}; constructor(){ console.log('constructor'); } ... …
Hanzo
  • 1,839
  • 4
  • 30
  • 51
0
votes
2 answers

Custom InjectableProvider for method multi param injectable, Error in parsing

I have a hard time having a nice and clean way to implement this JsonParamInjectable. I searched on this forum and elsewhere but found nowhere an hint that would tell me how to implement it nice and clean. For a jaxrs method : public Object add( …
sstlaurent
  • 25
  • 7
0
votes
1 answer

How would you inject and handle a database object from an object pool into a resource?

i've been thinking about implementing a object pool for jcouchdb objects for jersey. Now i am asking myself what would be the best way to deliver a jcouchdb instance to the resource endpoints. I expect the pool to have a method for requesting an…
Stefan
  • 721
  • 1
  • 10
  • 24