i have an interface with i want to inject . i have...
# kodein
k
i have an interface with i want to inject . i have bind it inside my
Application class
Copy code
bind() from provider { MyInterface }
and when i use it inside my reposition NextRepository(prival val view:MyInterface) . I got the below error :
Copy code
org.kodein.di.Kodein$NotFoundException: No binding found for bind<MyInterface>() with ?<MyMainClass>().? { ? }
    Registered in this Kodein container:
Inside my Main Class i have the following :
val view:MyInterface by instance()
What am i doing wrong ?
g
I think you should use interface like this:
bind<MyInterface>() with provider { MyInterfaceImpl() }
MyInterfaceImpl is some concrete class that implements MyInterface.