quirkey / sammy

Sammy is a tiny javascript framework built on top of jQuery, It's RESTful Evented Javascript.
http://sammyjs.org
MIT License
2.99k stars 384 forks source link

template rander cannot for each? #268

Open PHPJourney opened 5 years ago

PHPJourney commented 5 years ago

I'm use sammy.template plugins rander my application. on my page foreach can't rander . give me callback error info Uncaught SyntaxError: Unexpected token ? at new Function (<anonymous>) at srender (sammy.template.js:34) at context_prototype.template [as html] (sammy.template.js:135) at context_prototype.interpolate (sammy-0.7.6.min.js:5) at Sammy.RenderContext.<anonymous> (sammy-0.7.6.min.js:5) who tell me why?

gunnar-g commented 4 years ago

Can you give a code sample?

Something like this should work. <% fields.forEach(function(field) { %> ..... <% }); %>