11

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.

zion inc
  • 145
  • 1
  • 1
  • 9

3 Answers3

29

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

<div>
  yada yada.... &#123; ... &#125;  blah blah....
<div>
suhailvs
  • 20,182
  • 14
  • 100
  • 98
  • 1
    yes but only one. If you add two, the angular compiler interprets it as `{{ }}` sadly – Nico Nov 08 '20 at 20:42
13

You can bind the text to a string literal:

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

(if the text also has quote marks in it, you can escape them with \)

Edit: just saw your comment that you need to keep ngNonBindable. It looks like there's an open issue for that, so until that's fixed you may need to see if you can restructure your markup to remove the escaped text from the ngNonBindable section.

John Montgomery
  • 6,739
  • 9
  • 52
  • 68
5
<div>
  yada yada.... {{ '{' }} ... {{ '}' }}  blah blah....
<div>

there is a open bug for ngNonBindable

Toolkit
  • 10,779
  • 8
  • 59
  • 68