Skip to main content

Function: Module()

Module(metadata): ClassDecorator

Class decorator that designates a class as a module in the Aurora framework. A module groups related controllers, providers, and imported/exported modules into a cohesive unit for dependency scanning and resolution.

Parameters

metadata

ModuleMetadata

Configuration object defining:

  • imports: other modules whose providers/controllers should be available
  • controllers: controller classes to instantiate and bind
  • providers: service classes or tokens to register in the DI container
  • exports: subset of providers/controllers to expose to importing modules

Returns

ClassDecorator

Throws

  • If applied more than once to the same class.
  • If the metadata contains keys outside of the allowed set (imports, controllers, providers, exports).