# static template

## `RangeError.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}`](https://docs.angular-package.dev/error/commonerror/properties/static-template#problem), [`{fix}`](https://docs.angular-package.dev/error/commonerror/properties/static-template#fix) and optional [`{id}`](https://docs.angular-package.dev/error/commonerror/properties/static-template#id), [`{max}`](https://docs.angular-package.dev/error/commonerror/properties/static-template#max), [`{min}`](https://docs.angular-package.dev/error/commonerror/properties/static-template#min) tags.

By default, it's set to `Problem{id}: {problem} => Fix: {fix} between {min} and {max}`.

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

```typescript
public static template = `Problem{id}: {problem} must be between {min} and {max} => Fix: {fix}`;
```

{% endcode %}

## Example usage

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

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

// Returns
// RangeError: Problem((AE:427)): The `age` parameter is too big, got 455 => Fix: Set the `age` parameter of the `setAge()` method
new RangeError(
  'The `age` parameter is too big, got 455', // Problem
  'Set the `age` parameter of the `setAge()` method', // Fix
  '(AE:427)', // Identification
  9,  // Minimum
  27 // Maximum range
);
```


---

# 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.angular-package.dev/error/rangeerror/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.
