Nested “{{for}}” issue? [jsRender]-Collection of common programming errors
I am trying to put together a template with jsRender instead of my own version that I was on, but, I keep getting this: “Uncaught JsRender Error: Syntax error Unmatched or missing tag: “{{/for}}” in template:” followed by my entire template.
Here is a truncated version of my code, any ideas as to what is going on? Or is it just the nested for loops?
{{for sources}}
{{:title}}
{{for articles}}
// An if, else and some standard content insertion stuff is/was here
{{/for}}
{{/for}}
Screenshot of chrome’s dev tools showing my array structure:
Screenshot 1 of an expanded view:
And collapsed:
Any ideas as to what is going on?
EDIT: Forgot to mention, I am loading this from an external file using John Papa’s code
EDIT: Demo and code:
Chrome’s dev tools output of my array:
Object
info: Object
sources: Array[1]
0: Object
articles: Array[7]
0: Object
1: Object
2: Object
3: Object
4: Object
5: Object
6: Object
link: "http://lifehacker.com"
title: "Lifehacker"
Demo: http://jsfiddle.net/SO_AMK/3J7AE/
And of a working nested array:
Object
foo: "names"
testData: Array[2]
0: Object
markup: "John"
name: "John"
secondary: Array[1]
0: Object
1: Object
Demo: http://jsfiddle.net/SO_AMK/Vf8Bq/