1

How do I prevent Cyclone from converting the code? I mean, I want this line to be transfered as such to the browser so that Handlebar.js can use this as a template.

<script type="text/x-handlebars">
    My firstName is {{Employee.firstName}}
</script>

{{Employee.firstName}} should be evaluated on the client-side. But my cyclone server tries to evaluate it on server-side and throws up an error. How do I prevent this from happening and sending it to the browser as such? The code given above is what I want in the browser-side.

2 Answers 2

3

You should also consider not mixing your Handlebars and your Tornado/Cyclone templates in the same file. You could also just read the file, and return it and let the client do all of the rendering.

0

Well, I found the answer myself. looks like, I have to add an exclamation mark (!) as shown below from preventing cyclone evaluating the template. Like this,

<script type="text/x-handlebars">
    My firstName is {{!Employee.firstName}}
</script>

There it is.

1
  • In that case, handlebars is ignoring it as well!
    – lmc
    Jun 28, 2014 at 4:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.