E
E
Erling2016-06-03 15:37:37
Angular
Erling, 2016-06-03 15:37:37

Curly braces conflict in twig and AngularJS - how to resolve?

I use gulp-twig for templates in layout, there was a conflict due to curly braces of angular, which Twig does not understand when compiling and completes the task with errors.
Googled. Found it

angular.module("registerPageApp", []).config(function($interpolateProvider){
      $interpolateProvider.startSymbol('//').endSymbol('//')

Those. replace the angular brackets with other characters, but it seems to me that this is not the best solution. For the tweak should help us in development, and not complicate it, forcing us to pervert with rewriting the standard constructions of the whole framework.
Has anyone experienced this? How can the problem be properly solved? Thank you!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
Konstantin Kitmanov, 2016-06-03
@Erling

  • Look for a template engine that does not conflict with angular on special characters (see jade aka pug).
  • Or fence some escape sequences, if such is provided in twig at all.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question