Components
This page summarizes all the information about mandarine components and how & why they are used in Mandarine-powered applications.
What are components?
Mandarine has the concept of "components", components help diversify your application in different layers such as
Configuration Layer
Service Layer
ORM Layer
Others...
Components are used across Mandarine-powered applications mostly for dependency injection (DI) but its concept can go beyond, for example, Controllers are a type of component specifically created to handle HTTP requests (this if you are using Mandarine MVC).
Declaration
Components are declared by using typescript decorators (Click here to see more). All Component decorators should target a class.
Injecting objects
Most components accept the use of DI. DI can be achieved through class fields or by using constructor parameters.
Types of Components
Controller
Middleware
Repository
Component
Service
Configuration
Manual Component
Last updated