I have a task to show sparkline in angular web app, currently I use angular 12. the problem I face is, data sent by rest api like this:
{
"data" : "<span class='sparklines' values='1,2,3,4,5,4,3,2,1'></span>"
}
I already try to render that html string like this:
<div [innerHTML]="data"></div>
this.data = resp.data;
and html is shown as span with class sparklines,
I have an idea, may be I can trigger jquery.sparklines code every this.data changed. but it still and idea, because I dont have any idea how to do it in code.
how to execute jquery sparkline from html json string sent by rest api, without string extraction?
because sparklines is only one of jquery plugins that I need render.