> For the complete documentation index, see [llms.txt](https://docs.angular-package.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.angular-package.dev/text/wrapper/wrap/wrap-constructor.md).

# Wrap() constructor

### `Wrap()`

Creates a new instance of the [`Wrap`](/text/wrapper/wrap.md) with the opening and closing.

{% code title="wrap.class.ts" %}

```typescript
constructor(opening: Opening, closing: Closing) {
  super(Wrap.template`${opening}${closing}`);
  this.#closing = closing;
  this.#opening = opening;
}
```

{% endcode %}

#### Parameters

<table><thead><tr><th width="173.44477578337126">Name: type</th><th>Description</th></tr></thead><tbody><tr><td><code>opening: Opening</code></td><td>The wrap opening of a generic type variable <a href="/pages/SYPkCWCkQnshiX32nwLt#wrap-less-than-opening-...greater-than"><code>Opening</code></a>.</td></tr><tr><td><code>closing: Closing</code></td><td>The wrap closing of a generic type variable <a href="/pages/SYPkCWCkQnshiX32nwLt#wrap-less-than...-closing-greater-than"><code>Closing</code></a>.</td></tr></tbody></table>

#### Returns

The **return value** is a new instance of [`Wrap`](/text/wrapper/wrap.md) with the primitive value of the provided `opening` and `closing` if set properly, otherwise with an empty [`string`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String).

#### Usage

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

// Returns Wrap{'[]'}
new Wrap('[', ']');

// Returns Wrap{''}
new Wrap(null as any, null as any);
```
