Preventing Compilation of AngularJS Element Content

Is there a way to tell Angular not to compile the contents of certain elements?

Use Case:

Angular CMS contains elements textareato which CKEditor is attached. CKEditor uses the divarea plugin instead of the default iframe plugin. Text fields contain HTML templates. These templates are exported on demand and sent to Angular webapp.

The templates are quite simple: plain text, ordered lists, a random, predefined class attribute applied to plain text; but plain text may contain placeholders for Angular webapp for interpolation. I do not want Angular to interpolate them at all in CMS.

Currently my problem is that Angular in CMS interpolates these placeholders and, since they don't reference anything, removes them. I would rather not just change the delimiters to "{[',']}", since although this can fix it in the short term, the likelihood of a collision with the directive and copying the text increases as the project continues, and I would like to avoid this .

Is there any directive or other way to tell Angular to stay away from the contents of specially selected elements?

+4
source share
1 answer

Use the ng-non-bindabledirective for the element:

ngNonBindable Angular DOM. , , Angular , Angular.

terminal: true, , , ng-non-bindable.

+7

All Articles