# 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';
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.gapvelocity.ai/webmap/general/frontend/documentation/winforms-angular-components/conventions/coding.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
