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.

4
  • Possible duplicate stackoverflow.com/questions/13671701/…
    – Liam
    Aug 15, 2014 at 21:20
  • @Abhi the post doesn't mention Jekyll, or am I missing something?
    – Max
    Aug 15, 2014 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, 2014 at 21:22
  • oh ok got it - not sure if you can change the braces in Jekyll
    – Liam
    Aug 15, 2014 at 21:25

1 Answer 1

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 %}
1
  • Thanks! Re "Not sure what exactly you are trying to do", see question update.
    – Max
    Aug 18, 2014 at 13:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.