Search code examples
pythontwistedtornadohandlebars.jscyclone

Prevent cyclone from evaluating Handlebar's template


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.


Solution

  • 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.