• Factory Decorator Factory

    Annotate a class with the Factory decorator so that each time it is Injected, a new instance will be created with provided args, or the default args if none are provided.

    Example

    @Factory('Logger', {
    args: ["no namespace provided"]
    })
    class Logger {
    private namespace: string;
    constructor(namespace: string) {
    this.namespace = namespace;
    }
    }

    Returns

    • a class decorator

    Parameters

    Returns ClassDecorator

Generated using TypeDoc