AngularJS-Twig conflict with double curly braces

angularjstwig

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, but in some projects I can't, only JS.

Best Answer

You can change the start and end interpolation tags using interpolateProvider service. One convenient place for this is at the module initialization time.

angular.module('myApp', []).config(function($interpolateProvider){
    $interpolateProvider.startSymbol('{[{').endSymbol('}]}');
});

https://docs.angularjs.org/api/ng/provider/$interpolateProvider