How to escape single curly braces angular 4 template

zion inc picture zion inc · Aug 10, 2017 · Viewed 9.2k times · Source

I have something like

<div ngNonBindable>
  yada yada.... { ... }  blah blah....
<div>

Even with 'ngNonBindable' directive I get error:

compiler.es5.js:1690 Uncaught Error: Template parse errors:
Unexpected character "EOF" (Do you have an unescaped "{" in your template? Use "{{ '{' }}") to escape it.) ("
<div>

Two things:

1) Please point me in right direction.

2) Or, a workaround please.

Answer

suhailvs picture suhailvs · Jan 28, 2019

You can use Special Character for { --> &#123; and for } --> &#125;

<div>
  yada yada.... &#123; ... &#125;  blah blah....
<div>