Jason Goemaat Jason Goemaat - 6 months ago 51
AngularJS Question

How do I escape curly braces for display on page when using AngularJS?

I want the user to see double curly braces, but Angular binds them automatically. This is the opposite case of this question where they want to not see curly braces used for binding when the page is loading.

I want the user to see this:

My name is {{person.name}}.


But Angular replaces
{{person.name}}
with the value. I thought this might work, but angular still replaces it with the value:

{{person.name}}


Plunker: http://plnkr.co/edit/XBJjr6uR1rMAg3Ng7DiJ

Answer
<code ng-non-bindable>{{person.name}}</code>

Documentation @ http://docs.angularjs.org/api/ng.directive:ngNonBindable

Comments