How to make Angular work with Jinja templates

I use Jinja templates for my frontend development. When trying to use Angular code it failed as it tryied to compile it as Jinja.

In order to avoid conflict simply wrap it in a raw Jinja block. This will leave the curly braces intact when compiling the template.

{%raw%}
<input type="text" ng-model="yourName" placeholder="Enter a name here">

<h1>Hello {{yourName}}!</h1>
{%endraw%}

About Rick

Senior Front-end Software Engineer from Barcelona, Haidong Gumdo Instructor (korean martial art of the sword), street photographer, travel lover, TV addict, Boston Red Sox fan, and privacy advocate.

Leave a Reply

Add <code> Some Code </code> by using this tags.

*
*