AngularJS with Django - Conflicting template tags

前端 未结 12 2322
南笙
南笙 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:16

    If you did separate sections of page properly then you can easily use angularjs tags in "raw" tag scope.

    In jinja2

    {% raw %}
        // here you can write angularjs template tags.
    {% endraw %}
    

    In Django template (above 1.5)

    {% verbatim %}    
        // here you can write angularjs template tags.
    {% endverbatim %}
    

提交回复
热议问题