We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
Interface as Service
interface HelloService { fun doSomething(): String }
Implementation of Service
class HelloServiceImpl : HelloService { override fun doSomething(): String { return "Hello Service, Koin!" } }
Kotlin Module
val viewModelModules = module { viewModel { VariableInjectionVm(get()) } }
ViewModel
class VariableInjectionVm( private val helloService: HelloService ) : ViewModel() { fun demo(): String { return helloService.doSomething() } }