> For the complete documentation index, see [llms.txt](https://docs.gapvelocity.ai/webmap/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.gapvelocity.ai/webmap/general/frontend/documentation/winforms-angular-components/conventions/services.md).

# Services

## Services are singletons ( Style 07-01)

* Use services as singletons within the same injector. Use them for sharing data and funcionality.

## Single responsability (Style 07-02)

* create services with a single responsibility that is encapsulated by its context.

## Providing a services (Style 07-03)

* Provide services to the Angular injector at the top-most component where they will be shared.

## Use the @Injectable() class decorator (Style 07-04)

* Use the **@Injectable** class decorator instead of the **@Inject** parameter decorator when using types as tokens for the dependencies of a services.

```typescript
@Injectable()
export class HeroArena {
  constructor(
    private heroService: HeroService,
    private http: Http) {}
}
```
