Nested "{{for}}" loop issue?
See original GitHub issueHi, I am trying to put together a template with jsRender instead of my own version that I was on, but, I keep getting a: “Uncaught JsRender Error: Syntax error Unmatched or missing tag: “{{/for}}” in template:” error followed by my entire template (maybe it should just be the template name instead, it gets pretty long).
Here is a truncated version of my code, any ideas as to what is going on? Or is it just the nested for loops?
<div class="page" id="{{:info.id+info.name}}">
{{for sources}}
<header class="feed-title">
<div class="feed-title-content">
<span class="feed-title-text">{{:title}}</span>
</div>
</header>
<section class="row">
<div class="scroll-left"></div>
<div class="row-scroll">
{{for articles}}
// An if, else and some standard content insertion stuff was here
{{/for}}
</div>
<div class="scroll-right"></div>
</section>
{{/for}}
</div>
EDIT: Forgot to mention, I am loading this from an external file using John Papa’s code (http://msdn.microsoft.com/en-us/magazine/hh975379.aspx).
Issue Analytics
- State:
- Created 11 years ago
- Comments:10 (5 by maintainers)
Top Results From Across the Web
Why is my nested for loop not working as I expected?
The issue you're seeing is because of the nested for loop. You are essentially doing a cross-compare: for every item in i1, ...
Read more >Topic 6 Nested for Loops - UT Computer Science
A for loop can have more than one loop nested in it. A for loop can have more than one loop nested in...
Read more >Why are nested loops considered bad practice?
Nested loops increase cyclomatic complexity (see here), which decreases the maintainability of a program, according to some people. – Marco. May 29, 2013...
Read more >4.4. Nested For Loops — AP CSAwesome
A nested loop has one loop inside of another. These are typically used for working with two dimensions such as printing stars in...
Read more >Nested Loops cause performance issues - CAST Highlight
If the amount of data is large, nested loops are fully avoided due to performance issues. If the program is extracting small amount...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Nevermind, I gave up and switched to Handlebars
Did you mean like this?:
See http://www.jsviews.com/#parentdata