let project_card = "<div>Project ID: {{project_id}}</div>"; // Define a template with a placeholder for project_id
let data = [
{
project_id: "100",
},
];
let projectsHTML = "";
data.forEach((project) => {
console.log("Project:", project);
projectsHTML += Sqrl.render(project_card, project); // Render template with each data object
});
console.log(projectsHTML);
I also stripped it down to a 1 liner with the same error:
VM523:3 Uncaught ReferenceError: project_id is not defined
at eval (eval at O (squirrelly:1:8740), <anonymous>:3:52)
at e.render (squirrelly:1:9349)
at _display/?editor_console=true:116:12
I have been trying for awhile to get a basic example working in the browser.
I keep getting a project_id is undefined error.
Here is the JSFiddle: https://jsfiddle.net/5q4t8bsk/
Here is the code
I also stripped it down to a 1 liner with the same error:
Any ideas on what I am doing wrong?