Within myjavascript.js, I have an array like so:
games = [{name: "football"},{name:"basketball"}];
Within my games.handlebars I have included my javascript file at the top of the page as normal. I want to formulate a table like so:
{{#if games}}
{{#each games}}
<tr>{{name}}</tr>
{{/each}}
{{#else}}
<h1> No games </h1>
{{/if}}
I always seem to hit the else statement, it thinks games is empty. In the java-script console in my browser I can type games and it shows the object, i can see all the data in it.
What is it that I am doing wrong?