6

Both Angular.JS and Jekyll use {{ and }} to mark beginning and end of an expression. So, if you're using both, there's a conflict and Jekyll will typically wipe out or mess with the Angular expressions.

One fix is to tell Angular to use different symbols via $interpolateProvider, for example:

var app = angular.module('app', [],
    function($interpolateProvider) {
        $interpolateProvider.startSymbol('[[{').endSymbol('}]]');
    });

Is there also a way to tell Jekyll to use different start and end symbols?

UPDATE: Why? Just trying to find a less invasive way to resolve the conflict, as my projects typically contain a lot more Angular markup than Jekyll markup.

Max
  • 9,220
  • 10
  • 51
  • 83
  • Possible duplicate http://stackoverflow.com/questions/13671701/angularjs-twig-conflict-with-double-curly-braces – Liam Aug 15 '14 at 21:20
  • @Abhi the post doesn't mention Jekyll, or am I missing something? – Max Aug 15 '14 at 21:22
  • @Abhi OP asked for a way to change it in Jekyll, the link you provided have only solution for angularjs and Twig. – runTarm Aug 15 '14 at 21:22
  • oh ok got it - not sure if you can change the braces in Jekyll – Liam Aug 15 '14 at 21:25

1 Answers1

2

The double curly braces come from Liquid templating language. I think you cannot change it.

Not sure what exactly you are trying to do, but you might get away by using the raw tag. This tells liquid to ignore the code that is placed inside it and it won't try to interpret it:

{% raw %} 
{{ some angular code here }}
{% endraw %}
Mitja Bezenšek
  • 2,503
  • 1
  • 14
  • 17