admin 管理员组文章数量: 1086019
On our website we display user-generated content (blog posts etc.). It's rendered by a Symfony app. The frontend is currently being rewritten in the form of an Angular app. Now we noticed that when a user's blog post contains double curly brace notation, Angular will process it, which is undesired.
Is there a way in Angular to disable the double curly brace parsing for certain DOM elements?
On our website we display user-generated content (blog posts etc.). It's rendered by a Symfony app. The frontend is currently being rewritten in the form of an Angular app. Now we noticed that when a user's blog post contains double curly brace notation, Angular will process it, which is undesired.
Is there a way in Angular to disable the double curly brace parsing for certain DOM elements?
Share Improve this question asked Feb 4, 2014 at 17:03 Carlo ZottmannCarlo Zottmann 6155 silver badges12 bronze badges2 Answers
Reset to default 11Yes, use the ng-non-bindable directive. in the element that wraps your dynamic user editable content.
<div ng-non-bindable>{{some text}}</div>
I'm not sure about a direct answer for ignoring interpolation on certain elements but you can change the symbol used if it's in conflict with other data you have:
http://docs.angularjs/api/ng.$interpolateProvider#endsymbol
本文标签:
版权声明:本文标题:javascript - Is there a way to disable Angular's double curly brace notation for selected DOM elements? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.roclinux.cn/p/1744089383a2531745.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论