Skip to content

transformWith

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

transformWith

Select a data object or its subtree and transform with a template.

ST.select(DATA).transformWith(TEMPLATE)

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