Skip to main content

Questions tagged [inject]

Design pattern to reduce coupling between components, by dynamically injecting into a software component dependencies that it needs to function.

inject
0 votes
3 answers
43 views

HttpInterceptors and Dependency Injection Angular 18

I'm setting up a JWT interceptor in Angular 18.. I had this set up in Angular 8, although that was a completely different setup using a class which inherits HttpInterceptor. here I am using function ...
Jessie Lulham's user avatar
1 vote
0 answers
105 views

Error: NG0203: inject() must be called from an injection context such as a constructor

good evening, I am updating a library with the version of Angular 17, before I used Angular 13 and it worked correctly. However, when testing it in a project with Angular 17, it does not let me call ...
nivmtz's user avatar
  • 11
0 votes
0 answers
35 views

With MapStruct, every componentModel field option is read as Default

It's not important if I put cdi, jakarta or even spring. The compiler only read "default". I nead jakarta. @Mapper(componentModel = "jakarta-cdi") public interface DepartmentMapper ...
idronick's user avatar
0 votes
1 answer
24 views

Avoiding deploy-time exception when the bean is not found for injection

I have this issue: I'm deploying an application (.ear) to WebLogic/CDI and I have this in one of my classes: @Inject @MyAnnotation private IMyStuff stuff; Of course, if there is no bean with this @...
Sorin-Alexandru Cristescu's user avatar
1 vote
1 answer
38 views

Functionality change from constructor injection to inject() function

I have the following guard in my project: import { isPlatformServer } from '@angular/common'; import { Inject, Injectable, Optional, PLATFORM_ID } from '@angular/core'; @Injectable() export class ...
Nerses Nersesyan's user avatar
0 votes
0 answers
29 views

Not able to inject RedisCache/SyncCache/StatefulRedisConnection beans in micronaut 4.2.1 version

We are using Micronaut 2 with Redis and jdk11 in my aws lambda application. We have upgraded jdk17 with micronaut 4. As part of the upgrade, we are facing issue with Redis and getting io.micronaut....
Naresh Byredla's user avatar
0 votes
0 answers
36 views

HK2 bind multiple copies of an implementation to a contract, each with different constructor arguments?

Using HK2 in Java, is there a way to bind multiple instances of the same implementation class to the same contract with different qualifiers and different constructor arguments. Here is a contrived ...
akagixxer's user avatar
  • 1,839
0 votes
0 answers
24 views

@Inject giving null pointer exception in cucumber guice

@ScenarioScoped public class TestTempData { } @Inject TestTempData tmpData works >>>> FINE >>>> in below class public class MyStepDefClass { @Inject TestTempData tmpData; @...
Som's user avatar
  • 4,698
0 votes
0 answers
31 views

How to do DllInject in Java and jna

I would like to do DllInject using Java Jna.I know I'm new to Jna and C++, but I can't seem to get the code to mesh with the inject part.I would like to know if you can help me. Things were going well ...
halu86x's user avatar
0 votes
1 answer
40 views

Child component injecting undefined variable

I have a button in parent component in Vue.js, when I click the button I change a variables value and pass it to the child component. Now when I inject the variable inside my child component it gets ...
Newbie's user avatar
  • 21
0 votes
0 answers
33 views

core.mjs:11751 ERROR Error: NG0203: inject() must be called from an injection context such as a constructor, a factory function, a field initializer,

i keep getting this error after adding Firebase to my ionic projcet it is mostly this function provideFirebaseApp(() =>initializeApp(environment.firebaseConfig)` This my app.moule.ts what i put in ...
Dano's user avatar
  • 1
0 votes
3 answers
109 views

HTML injection in Angular

I have to transform this code in order to use it for html injection in an Angular app (in this way it doesn't load any css or animations). dataService.getThings().subscribe( (data) => { const ...
simonetassi's user avatar
0 votes
1 answer
533 views

Quarkus: Inject/Use CDI bean inside a non-CDI bean

I'm trying to inject my singleton bean into a non-bean class, but for now, I always get that my injected dependency is null. Quarkus: 3.2.2 @Named("singletonConfiguration") @Singleton public ...
Dmitry Sinyavskiy's user avatar
1 vote
1 answer
51 views

Vue Js 2 provide cannot be updated in Parent

I'm trying to use the provide functions in Vue.js 2.7 and i want to update one of the props through an async function but it doesn't update the injection in the children Parent.vue <template> ...
Manos Liod's user avatar
0 votes
1 answer
36 views

Angular - How to dynamically pass environment values inside forRoot in the app.module?

I would like to pass values taken from the related environment file (env.json) in the app.module but these values are not available at the moment of the initialization of the GtmModule (are available ...
redrom's user avatar
  • 11.6k

15 30 50 per page
1
2 3 4 5
68