Skip to content

Text Interpolation

Min Si Thu edited this page Jul 11, 2019 · 2 revisions

Text Interpolation

Troll-Hunter allows you to create reactive State and manipulate text interpolation.

Create a javascript state in Troll Hunter App!

let state = {
    name:"Welcome from Troll Hunter App!"
}
let app = new TrollHunter(state);
app.init();

init is used when you want to start text interpolation

Set var attribute of h1 element in html.

<h1 var="name"></h1>

To update State, you can use updateState method of app.

state.updateState("name","App by Troll Hunter!")
Clone this wiki locally