Skip to content

Implement constructor and life cycle methods arguments injection

Allow users to decorate methods with arguments:

@Component
class SomeClass {
    @PostConstruct
    public init(depOne: DepOne, depTwo: DepTwo) {
        // depOne, depTwo have to be injected during call
    }

    @BeforeDestroy
    public init(depOne: DepOne, depTwo: DepTwo) {
        // depOne, depTwo have to be injected during call
    }
}

@Component
class SomeClass {
    constructor(@Inject depOne: DepOne, @Inject depTwo: DepTwo) {
        // depOne, depTwo have to be injected during call
    }
}
Edited by Valerii