Category "dependency-injection"

Hilt injection in Android Services

I want to inject a class in Service. Lets have a look at the code below: class DeviceUtil @Inject constructor() { ... } @AndroidEntryPoint class LocationUpd

Generically Register All Concrete types for Lazy Loading in DI

I want to setup Lazy Loading of registered types in a generic way that does not require me to register each one individually. I can create an extension method t

edit inline angular (change detection strategy, subject, behavior subject)

my output Here is my code: https://stackblitz.com/edit/angular-ivy-w3lop5?file=src%2Fapp%2Fapp.component.html I am just a beginner for few days. I dont understa

How to pass runtime parameters to a ViewModel's constructor when using Hilt for dependency injection?

I'm wondering how to pass runtime parameters to a ViewModel's constructor while using Hilt for DI? Prior to using Hilt, I have a ViewModel that looks like this:

How to access a injected repository from a component's method

Lets say we injected this repository on a plugin/service-container.js import nodeFetch from 'node-fetch' import { AbortController as NodeAbortController } from

Nested FormGroupDirective in child components

There is a problem with FormGroupDirective dependency injection. I have an example of relation component to each other: <app-component-group> <child-

Quarkus Auth Server Disable JWT Issue

i wish to disable the auth server when running in dev mode, which I am able to do so with %dev.quarkus.oidc.enabled=false . But it causes an exception given bel

How to solve Dependency injection and Inconsistent accessibility parameter type '' in .Net 3 Worker service?

I am setting a .Net core worker services that will get some data from the database and pass that to an endpoints. So I am trying to set it up base on my .net MV

How to use a generic HostBuilder in a UWP application

In my WPF applications I use a generic HostBuilder in this way: public partial class App : Application { private readonly IHost _host; public App()

Spring boot autowired service all variable fields are null

Currently I have many spring boot services annotated with @Service. Every service works fine and there are no problems. There is a problem only with LogsService

Object gotten from the NestFactory has all the internal dependencies as undefined - NestJS

I get an object from NestFactory and then I call a function. There is another class injected inside service class. All the dependencies inside the service are n

SwiftUI Dependency Injection

I have a SwiftUI app, its a tab based app struct Tab_View: View { var body: some View { TabView{ Main1_View().tabItem {

Can a Kotlin Object be used as a Spring bean?

Kotlin allows for the definition of singleton objects. In dependency injection (DI) frameworks like Spring or CDI, the life cycle of beans can be defined as sin

How to get data from a repository from within a cubit?

i'm using flutter bloc. i want to emit the data from a repo to a state. how do i get the data from the repo to show in the cubit? This is my cubit: void getPro

Flutter Injectable Inject a Third Party Dependency

I've been spinning my wheels for hours on the simple question of how to inject http.Client into a flutter class when using injectable. They reference doing this

Problems with user secrets in .Net console apps

I've created a .Net 6 console app. I added user secrets, but I only get the values defined in the appsettings.json file. I use Visual Studio Professional 2022 v

How to register services with dependency container services by reflection in c#

I have an interface IProcessor and multiple processors implementing this interface: Processor1 : IProcessor Processor2 : IProcessor I want to inject these proc

Hilt: java.lang.ClassNotFoundException: Didn't find class "com.kotlin20test.Hilt_MyApp"

I have an error concerning Hilt, I"ve been trying to inject a retrofit interface I created using Hilt, Here is the error: java.lang.ClassNotFoundException: Di

Cannot create viewmodel from composalbe function

I have a view model. I am using Hilt. I can create this view model from activity, like this val model: ProfileViewModel by viewModels() However when I try to c

Dependency Injection in Startup.cs difficulties

I am trying to inject some Data into the Startup.cs file without success. For example, this injection works fine on my Email Class and I am able to read the _d