AngularJS with Django - Conflicting template tags

前端 未结 12 2255
南笙
南笙 2020-11-22 13:39

I want to use AngularJS with Django however they both use {{ }} as their template tags. Is there an easy way to change one of the two to use some other custom

12条回答
  •  醉梦人生
    2020-11-22 14:18

    I would stick with a solution that uses both django tags {{}} as well angularjs {{}} with a either a verbatim section or templatetag.

    That is simply because you can change the way angularjs works (as mentioned) via the $interpolateProvider.startSymbol $interpolateProvider.endSymbol but if you start to use other angularjs components like the ui-bootstrap you will find that some of the templates are ALREADY built with standard angularjs tags {{ }}.

    For example look at https://github.com/angular-ui/bootstrap/blob/master/template/dialog/message.html.

提交回复
热议问题