Problem with print function in templates, specially in Twigs/AngularJs

Ask a question+

Hi! I am new in AngularJs. I faced with the problem concerning print function in templates, especially in Twigs. AngularJs and Twig use the same ‘{{‘ ,’}}’ symbols to print something. Please help me to solve this problem. Thanks in advance.

Sara 170
add comment

2 Answers


In AngularJs you are allowed to change the print symbols and set another symbols whatever you want.You can use [[ ]], [{ }], {{{ }}}, // // etc…Its called Interpolation.You can create an angulars module for that changing and inject it wherever you want.Here is how you can do that:


Source: https://www.w3docs.com/snippets/angularjs/angularjs-and-symbols-conflict-with-twig.html

Jack 590

Thank you so much, Jack

add comment

You should use Verbatim, put AngularJs print function inside {% verbatim %}{% endverbatim %} block

Muhamed Aziz 320
add comment

Your Answer