---
title: Tangular
project: Total.js V5
version: 0.0.20
section: guides
language: en
license: MIT
url: https://totaljs.es/docs/total-js-v5/0-0-20/guides/tangular/
updated: 2026-11-16T15:32:27.494Z
---

# Tangular

> The Tangular template engine: compile and render templates and register helpers.

Tangular is the template engine used by `TEMPLATE()`, by audit messages and by the CMS. It is available as the global `Tangular`. The commands (`{{ value }}`, `{{ if }}`, `{{ foreach }}` and helpers) are described in [Views](../views/#templates).

```js
var template = Tangular.compile('<h1>{{ name }}</h1>{{ foreach item in items }}<p>{{ item.price | format(2) }}</p>{{ end }}');
var html = template({ name: 'Order', items: [{ price: 10 }] });
```

The compiled function is `template(model, [repository], [helpers])`: names in the template are read from the model, `$` is the repository. Values are HTML-encoded unless you use `| raw`. `Tangular.register(name, fn)` adds a helper for all templates.
