I’m using JsRender to render a template client-side. However, I’m unable to use the for loop tag to repeat an html-portion of the block because it seems to accept only arrays or objects. Instead, my JSON return a variable which is a number (the number of times I should repeat the block). How can I repeat html N times using JsRender?
I’m using JsRender to render a template client-side. However, I’m unable to use the
Share
I am not sure, that JsRender provide this functionality from the box. You can write your own tag, like here: Example Scenario: Creating custom helpers to iterate through fields
Demo: http://jsfiddle.net/6UeZC/