xInjection - v3.0.0
    Preparing search index...

    Class ProviderModuleClass

    Base class for creating OOP-style modules with composition pattern.

    Provides a clean separation between your custom module logic and the DI container by exposing all ProviderModule functionality through the module property.

    This avoids naming conflicts between your methods and ProviderModule methods.

    Injectable()
    class UserService {
    get(id: string) {
    // ... get logic
    }
    }

    class AuthModule extends ProviderModuleClass {
    constructor() {
    super({
    id: 'AuthModule',
    providers: [UserService],
    exports: [UserService],
    });
    }

    // Your custom methods - no conflicts with the `ProviderModule` class methods
    authenticateUser(userId: string) {
    const userService = this.module.get(UserService);

    return userService.get(userId);
    }
    }

    const authModule = new AuthModule();
    authModule.authenticateUser('123');
    Index

    Constructors

    Properties

    Constructors

    Properties

    The underlying ProviderModule instance. Access all DI container methods through this property.