I’m using c3.js to build charts, it uses a function that returns HTML to create a tooltip,
currently my code is :
generateToolTip (param1: string, param2: string) : string {
return "
<div>
<div>
" + param1 + "
</div>
<div>
" + param2 + "
</div>
...
</div>
";
}
Is there a way to properly generate this html from HTML template file?
Something like this :
generateToolTip (param1: string, param2: string) : string {
return render('MyTemplate.html', param1, param2);
}
MyTemplate.html [
<div>
{{ param1 }}
</div>
<div>
{{ param2 }}
</div>
]