双花括号AngularJS,嫩枝冲突 [英] AngularJS-Twig conflict with double curly braces

查看:295
本文介绍了双花括号AngularJS,嫩枝冲突的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如你所知,这两个角度和树枝具有共同控制建设 - 双大括号内。我怎样才能改变角度的默认值?

As you know, both angular and twig has common control construction - double curly braces. How can I change default value of Angular?

我知道我可以在枝条做,但在某些项目上我做不到,只有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('}]}');
});

<一个href=\"http://docs.angularjs.org/api/ng.$interpolateProvider\">http://docs.angularjs.org/api/ng.$interpolateProvider

这篇关于双花括号AngularJS,嫩枝冲突的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆