2

I have the following HTML:

<span>
    {{Client.FirstName}}
    {{Client.LastName}}
</span>

Angular keeps trying to replace them with object values AS IT SHOULD. However, I want to ignore the binding in this case as I want to render it as it to the client.

CodeMilian
  • 1,262
  • 2
  • 17
  • 41
  • Could you show your controller code? – Amir Dec 09 '15 at 07:37
  • I have no code for it right now, it pretty much is an empty controller. I just don't want the items inside the span to bind to anything in angular. – CodeMilian Dec 09 '15 at 07:38
  • Possible [duplicate](http://stackoverflow.com/questions/16868024/how-do-i-escape-curly-braces-for-display-on-page-when-using-angularjs) – Jason Goemaat Dec 09 '15 at 07:43

2 Answers2

5

You must use an existing angular directive called "ngNonBindable" you can take a look here.

https://docs.angularjs.org/api/ng/directive/ngNonBindable

<div>Normal: {{1 + 2}}</div> 
<div ng-non-bindable>Ignored: {{1 + 2}}</div>

Result for non-bindable is ---> {{1 + 2 }}

acostela
  • 2,597
  • 3
  • 33
  • 50
3

use this ng-non-bindable for more info https://docs.angularjs.org/api/ng/directive/ngNonBindable

ex :

<div ng-non-bindable>Ignored: {{1 + 2}}</div>
<span ng-non-bindable>
   {{Client.FirstName}}
   {{Client.LastName}}
</span>
Durgpal Singh
  • 11,481
  • 4
  • 37
  • 49