AngularJS-Twig conflict with double curly braces

前端 未结 11 780
孤独总比滥情好
孤独总比滥情好 2020-11-22 14:39

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

I know that I can do it in Twig,

11条回答
  •  感情败类
    2020-11-22 15:25

    As mentioned in similar question about Django and AngularJS, trick with changing default symbols (in Twig or AngularJS) can provide incompatibility with third-party software, which will use these symbols. So best advice I found in google: https://groups.google.com/d/msg/symfony2/kyebufz4M00/8VhF1KWsSAEJ

    TwigBundle does not provide a configuration for the lexer delimiters as changing them would forbid you to use any templates provided by shared bundles (including the exception templates provided by TwigBundle itself).

    However, you could use the raw tag around your angular templates to avoid the pain of escaping all curly braces: http://twig.sensiolabs.org/doc/tags/raw.html -- Christophe | Stof

    Tag was renamed to verbatim

提交回复
热议问题