1.1 Modules
Each application is set of various modules and each application requires at least root module.
Each module is set of:
- Controllers
- Routes which navigates to controllers
- Services / components / models
- Views (you can choose any templating engine)
- Imported modules
Use @Module( IModuleMetadata ) decorator to declare a module.
interface IModuleMetadata {
imports?: Array<Function | IProvider>;
exports?: Array<Function | IProvider>;
name?: string;
controllers: Array<IProvider | Function>;
providers?: Array<IProvider | Function>;
}
- Imports: contains list of modules to import (nested modules).
- Exports: list of services from current module to be exported.
- Name: root module does not require name all others must have provided name.
- Controllers: list of controllers which are bounded to this module.
- Providers: list of services / components / singletons