Stratal API Reference
    Preparing search index...

    Class ModuleRef

    Handle to a lazily loaded module, returned by LazyModuleLoader.load.

    Resolves providers from the global container, so singletons registered by the lazy module persist across requests.

    Note: request-scoped providers resolved via ModuleRef.get degrade to transient instances (there is no ambient request scope here). To obtain a true per-request instance, resolve the token from the request container inside a request scope instead.

    Index

    Constructors

    Properties

    Methods

    Constructors

    Properties

    moduleClass: Constructor

    The module class this ref was loaded from.

    Methods

    • Resolve a provider from the lazily loaded module (global scope).

      Type Parameters

      • T

      Parameters

      • token: InjectionToken<T>

      Returns T

    • Async variant of ModuleRef.get, matching the NestJS API shape.

      Type Parameters

      • T

      Parameters

      • token: InjectionToken<T>

      Returns Promise<T>