需要在 angular 应用程序内将小胡子样式文字打印到屏幕(“{{}}”)

Need to print mustache style literals to screen ("{{}}") inside angular app

在我的 AngularJS 应用程序中,我需要向用户展示他们可以在文本框内使用 Liquid Markup

不幸的是,LiquidMarkup 使用 {{ the_same_syntax_as_angular }} 并且我的解释文本被评估为 Angular 代码。

如何转义 Angular 的双胡子语法来打印示例?

<div ng-non-bindable>Ignored: {{ your Mustache example }}</div>

工作示例:

<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.23/angular.min.js"></script>
<body ng-app="">
<div>Normal: {{1 + 2}}</div>
<div ng-non-bindable>Ignored: {{1 + 2}}</div>
<div>Ignored inside the placeholder: <input ng-non-bindable placeholder="{{1 + 2}}"/></div>
</body>

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