简体   繁体   English

更改AngularJS的打开和关闭标签

[英]Change AngularJS opening and closing tags

I'm trying to change angular opening and closing tags, (for python django jinja, if that matter) So for example, instead of this 我正在尝试更改角度的打开和关闭标签,(对于python django jinja,如果有的话)所以例如,代替此

<div ng-app="">
    <span>name - type: <input type="text" ng-model="name" /></span>
    <span>name - output: {{name}}</span>
</div>

I'll have this 我要这个

<div ng-app="">
    <span>name - type: <input type="text" ng-model="name" /></span>
    <span>name - output: [[name]]</span>
</div>

And I've already tried this: 我已经尝试过了:

https://docs.angularjs.org/api/ng/provider/ $interpolateProvider https://docs.angularjs.org/api/ng/provider/ $ interpolateProvider

and it doesn't works at all. 而且根本不起作用。 I also tried to replace each {{ in the angularjs.js file, with [[ , (and }} with ]] ) and it's still doesn't change anything. 我还尝试用[[ ,(和}}]]]] )替换angularjs.js文件中的每个{{ ,但仍然没有任何改变。

And yes, I saw that it's not recommended to do something like this, (because of security reasons) but I still need that. 是的,我发现不建议这样做(由于安全原因),但我仍然需要这样做。

And i'm also need that in AngularJS, not in python. 而且我也需要在AngularJS中使用它,而不是在python中。 (to replace the symbols in angular, not in python) (用角号代替python中的符号)

How can I do that? 我怎样才能做到这一点?

So it has to be something like this: 所以它必须是这样的:

angular.module('YourAppName', [], function ($interpolateProvider) {
     $interpolateProvider.startSymbol('[[');
     $interpolateProvider.endSymbol(']]');     
}); 

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM