-
Notifications
You must be signed in to change notification settings - Fork 0
Looping & Templating
Min Si Thu edited this page Jul 12, 2019
·
2 revisions
TrollHunter allows looping and templating.
let state = {
people:["john","simon","carter"]
}
let templates = {
peopleProfile(value,index){
return `
<h3>${index}. ${value}</h3>
`;
}
}
let app = new TrollHunter(state);
app.setTemplates(templates);
In html file,
<div loop="people" template="peopleProfile"></div>