> 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/coding.md).

# Coding

## Clases (Style 03-01)

* Use upper camel case when naming classes.

```typescript
export class ExceptionService{
    constructor () { }
}
```

## Constants (Style 03-02)

* Declare variables with **const** if their values should not change during the application lifetime.
* Consider spelling **const** variables in lower camel case.
* tolerate *existing* **const** variables that are spelled in UPPER\_SNAKE\_CASE. Because some third party modules use it.

```typescript
export const mockHeroes = ['Sam', 'Jill']; // Prefer
export const heroesURL = 'api/heroes'; // Prefer
export const VILLAINS_URL  = 'api/villains'; // Tolerate
```

## Interfaces (Style 03-03)

* Name an interface using upper camel case.
* Naming an interface without an **I** prefix.
* Consider using a class instead of an interface. [Read about it.](https://github.com/angular/angular/issues/19632)

```typescript
import { Hero } from './hero.model';

@Injectable()
export class HeroCollectorService {
  hero: Hero;

  constructor() { }
}
```

## Properties and Methods (Style 03-04)

* Use lower camel case to name properties and methods.
* Do not use prefixing private properties and methods with an ***underscore***.

```typescript
export class ToastService {
  message: string;
  private toastCount: number;

  hide() {
    this.toastCount--;
    this.log();
  }

  private log() {
    console.log(this.message);
  }
}
```

## Import line spacing(Style 03-06)

* Leave one empty line between third party imports and applications imports.
* List the import lines alphabetized by the module.
* List destructed imported symbols alphabetically.

```typescript
import { Injectable } from '@angular/core';
import { Http }       from '@angular/http';

import { Hero } from './hero.model';
import { ExceptionService, SpinnerService, ToastService } from '../../core';
```
