Skip to content

Allow direct scalar value as service parameters #4

@Tom32i

Description

@Tom32i

Would require a way / format to specify if the argument is another service or just a string.

// An HTTP client service
class HTTPClient {}

// An API service
class API {
    /**
     * @param {HTTPClient} client
     * @param {String} hostname
     */
    constructor(client, hostname = 'localhost') {

    }
}

// It would be nice to inject scalar as parameter without having to define a parameter for it.
container.registerDefinition('client', HTTPClient);
container.registerDefinition('api', API, ['client', 'http://my.domain.com:8080']);

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions