Creates a JsExpression for embedding JavaScript values in HTML templates.
The type of the value being wrapped
A JSON-compatible value to wrap
A JsExpression that can be rendered in templates
import { expr } from 'tshtml';// Simple valueconst isActive = expr(true);// Objectconst config = expr({ threshold: 10, enabled: true });// Arrayconst items = expr([1, 2, 3]);// String expressionconst js = expr('calculateValue()'); Copy
import { expr } from 'tshtml';// Simple valueconst isActive = expr(true);// Objectconst config = expr({ threshold: 10, enabled: true });// Arrayconst items = expr([1, 2, 3]);// String expressionconst js = expr('calculateValue()');
Creates a JsExpression for embedding JavaScript values in HTML templates.