devdocs/assets/javascripts/templates/base.coffee
2013-10-24 20:49:33 +02:00

11 lines
279 B
CoffeeScript

app.templates.render = (name, value, args...) ->
template = app.templates[name]
if Array.isArray(value)
result = ''
result += template(val, args...) for val in value
result
else if typeof template is 'function'
template(value, args...)
else
template