My problem is that when i send data to handlebars template it converts my array of strings to array of variables:
res.render('index', {
title: 'Express' ,
chartT:"title",
lab:['test','test2','test3'],
dat:[1,3,5]
});
Template code:
<canvas id="myChart" width="400" height="400"></canvas>
<script>
var pollOptions = [{{{lab}}}];
var pollData = [{{{dat}}}];
createChart("mychart",pollOptions,pollData);
</script>
And the problem that in pollOptions i got this
var pollOptions = [test,test2,test3];
Uncaught ReferenceError: test is not defined
I don't know why the template convert them...
Thank you in advance for your help.