function Injectable
Since 0.1.0
Injectable(options?: InjectableOptions): SetuClassDecorator

Marks a class as injectable (eligible for DI container registration). When the DecoratorPlugin runs, injectable classes in its services list (or discovered) are registered with the DI container when present, or instantiated directly otherwise.

Examples

Example 1

@Injectable({ scope: 'singleton', token: 'user-service' })
class UserService { … }

Parameters

optional
options: InjectableOptions

Optional scope and token

Return Type

A class decorator

Usage

import { Injectable } from "decorator-plugin/src/index.ts";