Do not evaluate a variable

I have a site created using AngularJS. I need to put text on a page that looks something like this: Use {{name}} to display the username .

But AngularJS automatically tries to evaluate {{name}} . But in this case, I do not want this to be evaluated. I just want to show it as text.

I already tried to use Unicode characters: {{name}} . But he still estimates that ...

Is there any way to do this?

+5
source share
1 answer

Use the ngNonBindable directive

 <span ng-non-bindable>Use {{name}} to display the username.</span> 
+6
source

Source: https://habr.com/ru/post/1200996/


All Articles