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, specially in Twigs. AngularJs and Twig use the same ‘{{‘ ,’}}’ symbols to print something. Please help me to solve this problem. Thanks in advance.

Coin iconoffer bounty
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:
angular.module("Interpolation",[]) .config(["$interpolateProvider",function($interpolateProvider){ $interpolateProvider.startSymbol("[["); $interpolateProvider.endSymbol("]]"); }])

Thank you so much, Jack

add comment

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

add comment

Your Answer