AngularJS-Twig 与双花括号冲突 [英] AngularJS-Twig conflict with double curly braces
本文介绍了AngularJS-Twig 与双花括号冲突的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如你所知,angular 和 twig 都有共同的控制结构——双花括号.如何更改 Angular 的默认值?
As you know, both angular and twig has common control construction - double curly braces. How can I change default value of Angular?
我知道我可以在 Twig 中做到,但在某些项目中我不能,只有 JS.
I know that I can do it in Twig, but in some projects I can't, only JS.
推荐答案
您可以使用 interpolateProvider
服务更改开始和结束插值标签.一个方便的地方是在模块初始化时.
You can change the start and end interpolation tags using interpolateProvider
service. One convenient place for this is at the module initialization time.
angular.module('myApp', []).config(function($interpolateProvider){
$interpolateProvider.startSymbol('{[{').endSymbol('}]}');
});
https://docs.angularjs.org/api/ng/provider/$interpolateProvider
这篇关于AngularJS-Twig 与双花括号冲突的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文