I'm learning ember.js and would like to sometimes deactivate some chunks of code. I know {{! }}
works for single-line commenting inside <script type="text/x-handlebars">
, but I can't make it work for multi-line commenting. Maybe because I have conditional statements inside.
<script type="text/x-handlebars" id="stuff">
{{!
{{#if length}}
foobar
{{/if}}
}}
</script>
but then I got this error:
Uncaught Error: Parse error on line xx:
...ngth}} foobar {{/if}}}} {{ o
---------------------^
Expecting 'EOF', got 'OPEN_ENDBLOCK'
I also tried using <!-- ... -->
, while the section is not shown, but I also get this error:
Uncaught Error: Cannot perform operations on a Metamorph that is not in the DOM
this error doesn't show up if I just delete that chunk of code.
{{! ... }}
inside of the<!-- -->
comment. – CraigTeegarden