i have the following array as an example:
var myarray = [
device1: [ name:device1 ,
variables: [ variable1: [ name: variable1,
unit: "a unit",
value: "a value"
],
variable2: [ name: variable2,
unit: "a unit",
value: "a value"
]
]
],
device2: [ name:device2 ,
variables: [ variable1: [
name: variable1,
unit: "a unit",
value: "a value"
]
]
]
]
and i'm trying to display it on a template:
<body>
<div class="container">
<header>
<h1>MQTT Device Status List</h1>
</header>
<ul>
{{#each mqttmessages2}}
{{> mqttmessage2}}
{{/each}}
</ul>
</div>
</body>
<template name="mqttmessage2">
<li>{{name}} :
<ul>
{{#each variables}}
<li>{{name}} : {{value}} [ {{unit}} ] </li>
{{/each}}
</ul>
</li>
</template>
The array is passed by a template helper, i'm passing it to test the template, and later it will be replaced by a database reading plus a function that will arrange everything to look as it looks in "myarray":
Template.body.helpers({
mqttmessages2() {
console.log(myarray);
return myarray;
}
});
The problem is, the template displays nothing, I've been looking for the problem but can't seem to figure it out, the console displays no errors so i'm lost here.