As of v9.0.
!!! note
Using dependency injection in the frontend requires transpiling step. Hence, you need to use the [ext-template](https://github.com/espocrm/ext-template) repository for customization development.
In this article:
To inject a service into a class, apply @inject decorator with a needed class to a class property. Note that the injected class must be registered as a service.
Example:
import {inject} from 'di';
import Settings from 'models/settings';
class MyHelper {
@inject(Settings)
config
}
To register a service, apply @register decorator to a class.
Example:
import {register} from 'di';
@register()
class MyService {
}
storage
A local browser storage. Stored values preserved when re-visiting the site from the same device.
session-storage
A session browser storage. Stored values are not preserved when re-visiting the site.
models/settings
Config parameters.
models/preferences
User preferences parameters.
models/user
A current user.
language
Label translation functions.
metadata
Application metadata.
app-params
Application parameters.
model-factory
Creates models for specific entity types.
collection-factory
Creates collections for specific entity types.
acl-manager
Access control checking functions.
field-manager
A util related to record fields.
date-time
A date-time util.
theme-manager
Theme related functions.
number-util
A number util. For working with numbers.
view-helper
A view helper. Markdown, sanitizing, etc.
layout-manager
A record layout provider.
router
Navigation and routing functions. The confirm leave-out functionality.
web-socket-manager
Web-socket functions.
broadcast-channel
For communication between browser tabs.
page-title
A page title util.