coolony / kiwi

Simple yet powerful asynchronous JavaScript template engine based on jQuery Template syntax, usable server-side or client-side.
MIT License
41 stars 6 forks source link

Example Problem #8

Closed rhythmicdevil closed 12 years ago

rhythmicdevil commented 12 years ago

Hi, Engine looks great so far. In your examples you have this which actually fails because 'name' is undefined:

<!DOCTYPE html>

${title}

{{if name}} Hello, ${name|capitalize}! {{else}} Hello, dear unknown! {{/if}}

Should be something like this:

<!DOCTYPE html>

${title}

{{if typeof(name) != 'undefined'}} Hello, ${name|capitalize}! {{else}} Hello, dear unknown! {{/if}}

pierreis commented 12 years ago

This is just meant to be a general syntax example, not really a template working out of the box. I'm currently updating the doc, I'll add a line about this shortly.

Thanks for noticing.