invoke

inline operator fun <T : Any> MetalessInjectionScope.invoke(qualifier: Qualifier = EmptyQualifier): ReadOnlyProperty<Any?, T>

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"))
}

operator fun <T : Any> InjectionScope.invoke(identifier: Identifier<T>): ReadOnlyProperty<Any?, T>

Create an injector for the given identifier. See InjectionScope.inject for more information.

class Service(scope: InjectionScope) {
val controller by scope(Identifier(Controller::class))
}