# static template

## `TypeError.template`

A template of the error message of [`string`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) type with the replaceable [`{problem}`](/draft-5/commonerror/properties/static-template.md#problem), [`{fix}`](/draft-5/commonerror/properties/static-template.md#fix) and optional [`{id}`](/draft-5/commonerror/properties/static-template.md#id), [`{max}`](/draft-5/commonerror/properties/static-template.md#max), [`{min}`](/draft-5/commonerror/properties/static-template.md#min), [`{type}`](/draft-5/commonerror/properties/static-template.md#type) tags.

By default, it's set to `Problem{id}: {problem} => Fix: {fix} must be of the {type}`.

{% code title="type-error.class.ts" %}

```typescript
public static template = `Problem{id}: {problem} => Fix: {fix} must be of the {type}`;
```

{% endcode %}

## Example usage

```typescript
// Example usage.
import { TypeError } from '@angular-package/error'; 

// Change the template.
TypeError.template = `Problem({id}): {problem} => Fix: {fix}`;

// Returns
// TypeError: Problem(AE:427): The `age` parameter is wrong. => Fix: Provided `age` must be different type. 
new RangeError(
  'The `age` parameter is wrong.', // Problem
  'Provided `age` must be different type. ', // Fix
  'AE:427', // Identification
  'string',  // Type
);
```


---

# 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://error.angular-package.dev/draft-5/typeerror/properties/static-template.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.
