invoke
inline operator fun <T : Any> MetalessInjectionScope.invoke(qualifier: Qualifier = EmptyQualifier): ReadOnlyProperty<Any?, T>
Content copied to clipboard
Create an injector for the given class, turned to an identifier, and an optional qualifier. See InjectionScope.inject for more information.
class Service(scope: InjectionScope) {
val controller: Controller by scope()
val repository: Repository by scope(named("my-repository"))
}
Content copied to clipboard
operator fun <T : Any> InjectionScope.invoke(identifier: Identifier<T>): ReadOnlyProperty<Any?, T>
Content copied to clipboard
Create an injector for the given identifier. See InjectionScope.inject for more information.
class Service(scope: InjectionScope) {
val controller by scope(Identifier(Controller::class))
}
Content copied to clipboard