Skip to content

transform

Jair Andres Diaz Puentes edited this page Mar 15, 2018 · 1 revision

transform

Select a template or its subtree, and transform data with the selected template.

ST.select(TEMPLATE).transform(DATA)

ST.select({
      "{{#each items}}": {
        "type": "label",
        "text": "{{name}}"
      }
    })
    .transform({
      items: [
        { id: 1, name: "Ja" },
        { id: 2, name: "Ka" },
        { id: 3, name: "La" }
      ]
    })
    .root();
Clone this wiki locally